refactor(uncrustify): change rules to better align with the style guide

Add space around arithmetic operators '+' and '-'.
Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
Remove space between '((' or '))' of control statements.
Add space between ')' and '{' of control statements.
Remove space between function name and '(' on function declaration.
Collapse empty blocks between '{' and '}'.
Remove newline at the end of the file.
Remove newline between 'enum' and '{'.
Remove newline between '}' and ')' in a function invocation.
Remove newline between '}' and 'while' of 'do' statement.
This commit is contained in:
Dundar Goc
2022-04-29 13:53:42 +02:00
parent 0b3ae64480
commit eef8de4df0
91 changed files with 583 additions and 682 deletions

View File

@@ -624,8 +624,7 @@ event_T event_name2nr(const char_u *start, char_u **end)
int i;
// the event name ends with end of line, '|', a blank or a comma
for (p = start; *p && !ascii_iswhite(*p) && *p != ',' && *p != '|'; p++) {
}
for (p = start; *p && !ascii_iswhite(*p) && *p != ',' && *p != '|'; p++) {}
for (i = 0; event_names[i].name != NULL; i++) {
int len = (int)event_names[i].len;
if (len == p - start && STRNICMP(event_names[i].name, start, len) == 0) {
@@ -2608,8 +2607,7 @@ static int arg_augroup_get(char_u **argp)
char_u *arg = *argp;
int group = AUGROUP_ALL;
for (p = arg; *p && !ascii_iswhite(*p) && *p != '|'; p++) {
}
for (p = arg; *p && !ascii_iswhite(*p) && *p != '|'; p++) {}
if (p > arg) {
char_u *group_name = vim_strnsave(arg, (size_t)(p - arg));
group = augroup_find((char *)group_name);