From 0b3ae64480ea28bb57783c2269a61f0a60ffc55e Mon Sep 17 00:00:00 2001 From: Dundar Goc Date: Fri, 29 Apr 2022 13:52:43 +0200 Subject: refactor(uncrustify): format all c code under /src/nvim/ --- src/nvim/autocmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/autocmd.c') diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 783cec4d60..a639364328 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -4,6 +4,7 @@ // autocmd.c: Autocommand related functions #include +#include "lauxlib.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" @@ -28,8 +29,6 @@ #include "nvim/vim.h" #include "nvim/window.h" -#include "lauxlib.h" - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "auevents_name_map.generated.h" # include "autocmd.c.generated.h" -- cgit From eef8de4df0247157e57f306062b1b86e01a41454 Mon Sep 17 00:00:00 2001 From: Dundar Goc Date: Fri, 29 Apr 2022 13:53:42 +0200 Subject: 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. --- src/nvim/autocmd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/nvim/autocmd.c') diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index a639364328..8830be7355 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -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); -- cgit