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

@@ -512,7 +512,7 @@ void extmark_adjust(buf_T *buf, linenr_T line1, linenr_T line2, long amount, lon
bcount_t old_byte = 0, new_byte = 0;
int old_row, new_row;
if (amount == MAXLNUM) {
old_row = (int)(line2 - line1+1);
old_row = (int)(line2 - line1 + 1);
// TODO(bfredl): ej kasta?
old_byte = (bcount_t)buf->deleted_bytes2;
@@ -526,11 +526,11 @@ void extmark_adjust(buf_T *buf, linenr_T line1, linenr_T line2, long amount, lon
new_row = (int)amount;
}
if (new_row > 0) {
new_byte = ml_find_line_or_offset(buf, line1+new_row, NULL, true)
new_byte = ml_find_line_or_offset(buf, line1 + new_row, NULL, true)
- start_byte;
}
extmark_splice_impl(buf,
(int)line1-1, 0, start_byte,
(int)line1 - 1, 0, start_byte,
old_row, 0, old_byte,
new_row, 0, new_byte, undo);
}
@@ -609,18 +609,18 @@ void extmark_splice_impl(buf_T *buf, int start_row, colnr_T start_col, bcount_t
// merge algorithm later.
if (old_row == 0 && new_row == 0 && kv_size(uhp->uh_extmark)) {
ExtmarkUndoObject *item = &kv_A(uhp->uh_extmark,
kv_size(uhp->uh_extmark)-1);
kv_size(uhp->uh_extmark) - 1);
if (item->type == kExtmarkSplice) {
ExtmarkSplice *splice = &item->data.splice;
if (splice->start_row == start_row && splice->old_row == 0
&& splice->new_row == 0) {
if (old_col == 0 && start_col >= splice->start_col
&& start_col <= splice->start_col+splice->new_col) {
&& start_col <= splice->start_col + splice->new_col) {
splice->new_col += new_col;
splice->new_byte += new_byte;
merged = true;
} else if (new_col == 0
&& start_col == splice->start_col+splice->new_col) {
&& start_col == splice->start_col + splice->new_col) {
splice->old_col += old_col;
splice->old_byte += old_byte;
merged = true;