aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/indent_c.c
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2022-10-22 12:36:38 +0200
committerdundargoc <gocdundar@gmail.com>2022-11-06 11:44:10 +0100
commit731cdde28ea8d48cc23ba2752a08c261c87eee92 (patch)
tree92e814050fdbca64aca435f03975b6d5678fbdf3 /src/nvim/indent_c.c
parenta79d28e4d7939c13f38cf4ce63ff240011bca96d (diff)
downloadrneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.tar.gz
rneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.tar.bz2
rneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.zip
refactor: fix clang-tidy warnings
Enable and fix bugprone-misplaced-widening-cast warning. Fix some modernize-macro-to-enum and readability-else-after-return warnings, but don't enable them. While the warnings can be useful, they are in general too noisy to enable.
Diffstat (limited to 'src/nvim/indent_c.c')
-rw-r--r--src/nvim/indent_c.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c
index 5eed2601d5..5a38fb5aae 100644
--- a/src/nvim/indent_c.c
+++ b/src/nvim/indent_c.c
@@ -458,9 +458,8 @@ bool cin_iscase(const char_u *s, bool strict)
// JS etc.
if (strict) {
return false; // stop at string
- } else {
- return true;
}
+ return true;
}
}
return false;
@@ -2877,14 +2876,13 @@ int get_c_indent(void)
// Line below current line is the one that starts a
// (possibly broken) line ending in a comma.
break;
- } else {
- amount = get_indent();
- if (curwin->w_cursor.lnum - 1 == ourscope) {
- // line above is start of the scope, thus current
- // line is the one that stars a (possibly broken)
- // line ending in a comma.
- break;
- }
+ }
+ amount = get_indent();
+ if (curwin->w_cursor.lnum - 1 == ourscope) {
+ // line above is start of the scope, thus current
+ // line is the one that stars a (possibly broken)
+ // line ending in a comma.
+ break;
}
}