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

@@ -2601,7 +2601,7 @@ void clear_showcmd(void)
sprintf((char *)showcmd_buf, "%d-%d", chars, bytes);
}
}
int limit = ui_has(kUIMessages) ? SHOWCMD_BUFLEN-1 : SHOWCMD_COLS;
int limit = ui_has(kUIMessages) ? SHOWCMD_BUFLEN - 1 : SHOWCMD_COLS;
showcmd_buf[limit] = NUL; // truncate
showcmd_visual = true;
} else {
@@ -2659,7 +2659,7 @@ bool add_to_showcmd(int c)
}
size_t old_len = STRLEN(showcmd_buf);
size_t extra_len = STRLEN(p);
size_t limit = ui_has(kUIMessages) ? SHOWCMD_BUFLEN-1 : SHOWCMD_COLS;
size_t limit = ui_has(kUIMessages) ? SHOWCMD_BUFLEN - 1 : SHOWCMD_COLS;
if (old_len + extra_len > limit) {
size_t overflow = old_len + extra_len - limit;
memmove(showcmd_buf, showcmd_buf + overflow, old_len - overflow + 1);
@@ -2887,8 +2887,7 @@ static void nv_ignore(cmdarg_T *cap)
/// Command character that doesn't do anything, but unlike nv_ignore() does
/// start edit(). Used for "startinsert" executed while starting up.
static void nv_nop(cmdarg_T *cap)
{
}
{}
/// Command character doesn't exist.
static void nv_error(cmdarg_T *cap)