diff options
-rw-r--r-- | src/nvim/api/private/helpers.h | 6 | ||||
-rw-r--r-- | src/nvim/autocmd.c | 3 | ||||
-rw-r--r-- | src/nvim/buffer_defs.h | 2 | ||||
-rw-r--r-- | src/nvim/decoration.c | 1 | ||||
-rw-r--r-- | src/nvim/decoration_provider.c | 4 | ||||
-rw-r--r-- | src/nvim/digraph.c | 6 | ||||
-rw-r--r-- | src/nvim/digraph.h | 2 | ||||
-rw-r--r-- | src/nvim/eval/funcs.c | 2 | ||||
-rw-r--r-- | src/nvim/fileio.c | 14 | ||||
-rw-r--r-- | src/nvim/getchar.c | 6 | ||||
-rw-r--r-- | src/nvim/highlight_group.c | 14 | ||||
-rw-r--r-- | src/nvim/highlight_group.h | 2 | ||||
-rw-r--r-- | src/nvim/main.c | 6 | ||||
-rw-r--r-- | src/nvim/match.c | 31 | ||||
-rw-r--r-- | src/nvim/os/pty_process_win.c | 2 | ||||
-rw-r--r-- | src/nvim/regexp.h | 1 | ||||
-rw-r--r-- | src/nvim/screen.h | 2 | ||||
-rw-r--r-- | src/nvim/sign.c | 3 | ||||
-rw-r--r-- | src/nvim/testing.c | 2 | ||||
-rw-r--r-- | src/nvim/testing.h | 2 | ||||
-rw-r--r-- | src/nvim/tui/input.c | 2 | ||||
-rw-r--r-- | src/nvim/ui.c | 2 | ||||
-rw-r--r-- | src/nvim/ui_client.c | 18 | ||||
-rw-r--r-- | src/nvim/ui_client.h | 5 | ||||
-rw-r--r-- | src/uncrustify.cfg | 2 |
25 files changed, 70 insertions, 70 deletions
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 650349cde7..bbbc3de7d5 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -140,9 +140,9 @@ typedef struct { // Useful macro for executing some `code` for each item in an array. #define FOREACH_ITEM(a, __foreach_item, code) \ - for (size_t (__foreach_item ## _index) = 0; (__foreach_item ## _index) < (a).size; \ - (__foreach_item ## _index)++) { \ - Object __foreach_item = (a).items[__foreach_item ## _index]; \ + for (size_t (__foreach_item##_index) = 0; (__foreach_item##_index) < (a).size; \ + (__foreach_item##_index)++) { \ + Object __foreach_item = (a).items[__foreach_item##_index]; \ code; \ } 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 <signal.h> +#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" diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index c71d022018..1d994a9ff0 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -1154,7 +1154,7 @@ struct VimMenu { char *name; ///< Name of menu, possibly translated char *dname; ///< Displayed Name ("name" without '&') char *en_name; ///< "name" untranslated, NULL when - ///< was not translated + ///< was not translated char *en_dname; ///< NULL when "dname" untranslated int mnemonic; ///< mnemonic key (after '&') char *actext; ///< accelerator text (after TAB) diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c index a0f189ca38..ba49c7f527 100644 --- a/src/nvim/decoration.c +++ b/src/nvim/decoration.c @@ -538,7 +538,6 @@ void decor_add_ephemeral(int start_row, int start_col, int end_row, int end_col, } - int decor_virt_lines(win_T *wp, linenr_T lnum, VirtLines *lines) { buf_T *buf = wp->w_buffer; diff --git a/src/nvim/decoration_provider.c b/src/nvim/decoration_provider.c index 6efcb08b9d..66ec5ba19f 100644 --- a/src/nvim/decoration_provider.c +++ b/src/nvim/decoration_provider.c @@ -16,8 +16,8 @@ static kvec_t(DecorProvider) decor_providers = KV_INITIAL_VALUE; LUA_NOREF, LUA_NOREF, LUA_NOREF, \ LUA_NOREF, -1 } -static bool decor_provider_invoke(NS ns_id, const char *name, LuaRef ref, - Array args, bool default_true, char **perr) +static bool decor_provider_invoke(NS ns_id, const char *name, LuaRef ref, Array args, + bool default_true, char **perr) { Error err = ERROR_INIT; diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 2a6ccce79e..02851b235f 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -36,11 +36,11 @@ typedef struct digraph { } digr_T; static char e_digraph_must_be_just_two_characters_str[] - = N_("E1214: Digraph must be just two characters: %s"); + = N_("E1214: Digraph must be just two characters: %s"); static char e_digraph_argument_must_be_one_character_str[] - = N_("E1215: Digraph must be one character: %s"); + = N_("E1215: Digraph must be one character: %s"); static char e_digraph_setlist_argument_must_be_list_of_lists_with_two_items[] - = N_("E1216: digraph_setlist() argument must be a list of lists with two items"); + = N_("E1216: digraph_setlist() argument must be a list of lists with two items"); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "digraph.c.generated.h" diff --git a/src/nvim/digraph.h b/src/nvim/digraph.h index 80b4148213..039fc3370d 100644 --- a/src/nvim/digraph.h +++ b/src/nvim/digraph.h @@ -1,8 +1,8 @@ #ifndef NVIM_DIGRAPH_H #define NVIM_DIGRAPH_H -#include "nvim/ex_cmds_defs.h" #include "nvim/eval/funcs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index dfdabd511e..1665c82e1e 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -15,8 +15,8 @@ #include "nvim/charset.h" #include "nvim/context.h" #include "nvim/cursor.h" -#include "nvim/digraph.h" #include "nvim/diff.h" +#include "nvim/digraph.h" #include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/decode.h" diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index c4eb1200ec..d8040219ca 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -19,8 +19,8 @@ #include "nvim/cursor.h" #include "nvim/diff.h" #include "nvim/edit.h" -#include "nvim/eval/userfunc.h" #include "nvim/eval/typval.h" +#include "nvim/eval/userfunc.h" #include "nvim/ex_cmds.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" @@ -5070,12 +5070,12 @@ int buf_check_timestamp(buf_T *buf) switch (do_dialog(VIM_WARNING, (char_u *)_("Warning"), (char_u *)tbuf, (char_u *)_("&OK\n&Load File\nLoad File &and Options"), 1, NULL, true)) { - case 2: - reload = RELOAD_NORMAL; - break; - case 3: - reload = RELOAD_DETECT; - break; + case 2: + reload = RELOAD_NORMAL; + break; + case 3: + reload = RELOAD_DETECT; + break; } } else if (State > NORMAL_BUSY || (State & CMDLINE) || already_warned) { if (*mesg2 != NUL) { diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index eb78317ee7..9fc4c297f5 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1261,9 +1261,9 @@ static int old_KeyStuffed; // whether old_char was stuffed static bool can_get_old_char(void) { - // If the old character was not stuffed and characters have been added to - // the stuff buffer, need to first get the stuffed characters instead. - return old_char != -1 && (old_KeyStuffed || stuff_empty()); + // If the old character was not stuffed and characters have been added to + // the stuff buffer, need to first get the stuffed characters instead. + return old_char != -1 && (old_KeyStuffed || stuff_empty()); } /* diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c index a9ced84280..9376ce6a3b 100644 --- a/src/nvim/highlight_group.c +++ b/src/nvim/highlight_group.c @@ -4,8 +4,9 @@ // highlight_group.c: code for managing highlight groups #include <stdbool.h> -#include "nvim/autocmd.h" + #include "nvim/api/private/helpers.h" +#include "nvim/autocmd.h" #include "nvim/charset.h" #include "nvim/cursor_shape.h" #include "nvim/fold.h" @@ -34,11 +35,11 @@ Map(cstr_t, int) highlight_unames = MAP_INIT; /// The "term", "cterm" and "gui" arguments can be any combination of the /// following names, separated by commas (but no spaces!). static char *(hl_name_table[]) = - { "bold", "standout", "underline", "underlineline", "undercurl", "underdot", - "underdash", "italic", "reverse", "inverse", "strikethrough", "nocombine", "NONE" }; +{ "bold", "standout", "underline", "underlineline", "undercurl", "underdot", + "underdash", "italic", "reverse", "inverse", "strikethrough", "nocombine", "NONE" }; static int hl_attr_table[] = - { HL_BOLD, HL_STANDOUT, HL_UNDERLINE, HL_UNDERLINELINE, HL_UNDERCURL, HL_UNDERDOT, HL_UNDERDASH, - HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_STRIKETHROUGH, HL_NOCOMBINE, 0 }; +{ HL_BOLD, HL_STANDOUT, HL_UNDERLINE, HL_UNDERLINELINE, HL_UNDERCURL, HL_UNDERDOT, HL_UNDERDASH, + HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_STRIKETHROUGH, HL_NOCOMBINE, 0 }; /// Structure that stores information about a highlight group. /// The ID of a highlight group is also called group ID. It is the index in @@ -1572,8 +1573,7 @@ const char *highlight_color(const int id, const char *const what, const int mode /// @param id highlight group id /// @param force_newline always start a new line /// @return true when started a new line. -bool syn_list_header(const bool did_header, const int outlen, const int id, - bool force_newline) +bool syn_list_header(const bool did_header, const int outlen, const int id, bool force_newline) { int endcol = 19; bool newline = true; diff --git a/src/nvim/highlight_group.h b/src/nvim/highlight_group.h index 325113a4ab..1474588889 100644 --- a/src/nvim/highlight_group.h +++ b/src/nvim/highlight_group.h @@ -1,8 +1,8 @@ #ifndef NVIM_HIGHLIGHT_GROUP_H #define NVIM_HIGHLIGHT_GROUP_H -#include "nvim/types.h" #include "nvim/eval.h" +#include "nvim/types.h" #define MAX_HL_ID 20000 // maximum value for a highlight ID. diff --git a/src/nvim/main.c b/src/nvim/main.c index 35d01f2407..c0b565fff7 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -835,8 +835,8 @@ static uint64_t server_connect(char *server_addr, const char **errmsg) } /// Handle remote subcommands -static void remote_request(mparm_T *params, int remote_args, - char *server_addr, int argc, char **argv) +static void remote_request(mparm_T *params, int remote_args, char *server_addr, int argc, + char **argv) { const char *connect_error = NULL; uint64_t chan = server_connect(server_addr, &connect_error); @@ -884,7 +884,7 @@ static void remote_request(mparm_T *params, int remote_args, TriState should_exit = kNone; TriState tabbed = kNone; - for (size_t i = 0; i < rvobj.data.dictionary.size ; i++) { + for (size_t i = 0; i < rvobj.data.dictionary.size; i++) { if (strcmp(rvobj.data.dictionary.items[i].key.data, "errmsg") == 0) { if (rvobj.data.dictionary.items[i].value.type != kObjectTypeString) { mch_errmsg("vim._cs_remote returned an unexpected type for 'errmsg'\n"); diff --git a/src/nvim/match.c b/src/nvim/match.c index ed320eb6fc..afbf28c77b 100644 --- a/src/nvim/match.c +++ b/src/nvim/match.c @@ -4,6 +4,7 @@ // match.c: functions for highlighting matches #include <stdbool.h> + #include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/fold.h" @@ -504,9 +505,9 @@ void prepare_search_hl(win_T *wp, match_T *search_hl, linenr_T lnum) FUNC_ATTR_NONNULL_ALL { matchitem_T *cur; // points to the match list - match_T *shl; // points to search_hl or a match - bool shl_flag; // flag to indicate whether search_hl - // has been processed or not + match_T *shl; // points to search_hl or a match + bool shl_flag; // flag to indicate whether search_hl + // has been processed or not // When using a multi-line pattern, start searching at the top // of the window or just after a closed fold. @@ -583,10 +584,10 @@ bool prepare_search_hl_line(win_T *wp, linenr_T lnum, colnr_T mincol, char_u **l match_T *search_hl, int *search_attr, bool *search_attr_from_match) { matchitem_T *cur = wp->w_match_head; // points to the match list - match_T *shl; // points to search_hl or a match - bool shl_flag = false; // flag to indicate whether search_hl - // has been processed or not - bool area_highlighting = false; + match_T *shl; // points to search_hl or a match + bool shl_flag = false; // flag to indicate whether search_hl + // has been processed or not + bool area_highlighting = false; // Handle highlighting the last used search pattern and matches. // Do this for both search_hl and the match list. @@ -663,10 +664,10 @@ int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match bool *search_attr_from_match) { matchitem_T *cur = wp->w_match_head; // points to the match list - match_T *shl; // points to search_hl or a match - bool shl_flag = false; // flag to indicate whether search_hl - // has been processed or not - int search_attr = 0; + match_T *shl; // points to search_hl or a match + bool shl_flag = false; // flag to indicate whether search_hl + // has been processed or not + int search_attr = 0; // Do this for 'search_hl' and the match list (ordered by priority). while (cur != NULL || !shl_flag) { @@ -781,7 +782,7 @@ int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match bool get_prevcol_hl_flag(win_T *wp, match_T *search_hl, long curcol) { - long prevcol = curcol; + long prevcol = curcol; matchitem_T *cur; // points to the match list // we're not really at that column when skipping some text @@ -808,9 +809,9 @@ bool get_prevcol_hl_flag(win_T *wp, match_T *search_hl, long curcol) void get_search_match_hl(win_T *wp, match_T *search_hl, long col, int *char_attr) { matchitem_T *cur = wp->w_match_head; // points to the match list - match_T *shl; // points to search_hl or a match - bool shl_flag = false; // flag to indicate whether search_hl - // has been processed or not + match_T *shl; // points to search_hl or a match + bool shl_flag = false; // flag to indicate whether search_hl + // has been processed or not *char_attr = search_hl->attr; while (cur != NULL || !shl_flag) { diff --git a/src/nvim/os/pty_process_win.c b/src/nvim/os/pty_process_win.c index 5bbd22c610..52967a85a3 100644 --- a/src/nvim/os/pty_process_win.c +++ b/src/nvim/os/pty_process_win.c @@ -49,7 +49,7 @@ int pty_process_spawn(PtyProcess *ptyproc) if (!os_has_conpty_working() || (conpty_object = - os_conpty_init(&in_name, &out_name, ptyproc->width, ptyproc->height)) == NULL) { + os_conpty_init(&in_name, &out_name, ptyproc->width, ptyproc->height)) == NULL) { status = UV_ENOSYS; goto cleanup; } diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index 6edbcf8a31..085f78af54 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -19,6 +19,7 @@ // regexp.c #ifdef INCLUDE_GENERATED_DECLARATIONS # include "regexp.h.generated.h" + # include "regexp_bt.h.generated.h" #endif diff --git a/src/nvim/screen.h b/src/nvim/screen.h index 330ff1d4a1..33b713e756 100644 --- a/src/nvim/screen.h +++ b/src/nvim/screen.h @@ -24,7 +24,7 @@ typedef enum { WC_TOP_LEFT = 0, WC_TOP_RIGHT, WC_BOTTOM_LEFT, - WC_BOTTOM_RIGHT + WC_BOTTOM_RIGHT, } WindowCorner; /// By default, all windows are drawn on a single rectangular grid, represented by diff --git a/src/nvim/sign.c b/src/nvim/sign.c index 6685c2f231..f0712442a2 100644 --- a/src/nvim/sign.c +++ b/src/nvim/sign.c @@ -5,8 +5,6 @@ // sign.c: functions for managing with signs // -#include "nvim/sign.h" - #include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/charset.h" @@ -18,6 +16,7 @@ #include "nvim/move.h" #include "nvim/option.h" #include "nvim/screen.h" +#include "nvim/sign.h" #include "nvim/syntax.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/testing.c b/src/nvim/testing.c index 5771ec4445..1e051c945a 100644 --- a/src/nvim/testing.c +++ b/src/nvim/testing.c @@ -3,9 +3,9 @@ // testing.c: Support for tests +#include "nvim/eval.h" #include "nvim/eval/encode.h" #include "nvim/ex_docmd.h" -#include "nvim/eval.h" #include "nvim/os/os.h" #include "nvim/testing.h" diff --git a/src/nvim/testing.h b/src/nvim/testing.h index 34ee1d10df..1522ebc7b7 100644 --- a/src/nvim/testing.h +++ b/src/nvim/testing.h @@ -1,8 +1,8 @@ #ifndef NVIM_TESTING_H #define NVIM_TESTING_H -#include "nvim/eval/typval.h" #include "nvim/eval/funcs.h" +#include "nvim/eval/typval.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "testing.h.generated.h" diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 399ad325d1..fbbd6f1bc2 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -13,8 +13,8 @@ #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/tui/tui.h" #include "nvim/tui/input.h" +#include "nvim/tui/tui.h" #include "nvim/vim.h" #ifdef WIN32 # include "nvim/os/os_win_console.h" diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 4fe3e1157c..564d8d22b4 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -12,7 +12,6 @@ #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/cursor_shape.h" -#include "nvim/msgpack_rpc/channel.h" #include "nvim/diff.h" #include "nvim/event/loop.h" #include "nvim/ex_cmds2.h" @@ -25,6 +24,7 @@ #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/move.h" +#include "nvim/msgpack_rpc/channel.h" #include "nvim/normal.h" #include "nvim/option.h" #include "nvim/os/input.h" diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c index 6a7695bf72..4d1b9b1c52 100644 --- a/src/nvim/ui_client.c +++ b/src/nvim/ui_client.c @@ -1,20 +1,20 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> #include <stdbool.h> #include <stdint.h> -#include <assert.h> -#include "nvim/vim.h" +#include "nvim/api/private/dispatch.h" +#include "nvim/api/private/helpers.h" +#include "nvim/highlight.h" #include "nvim/log.h" #include "nvim/map.h" -#include "nvim/ui_client.h" -#include "nvim/api/private/helpers.h" #include "nvim/msgpack_rpc/channel.h" -#include "nvim/api/private/dispatch.h" -#include "nvim/ui.h" -#include "nvim/highlight.h" #include "nvim/screen.h" +#include "nvim/ui.h" +#include "nvim/ui_client.h" +#include "nvim/vim.h" static Map(String, UIClientHandler) ui_client_handlers = MAP_INIT; @@ -109,7 +109,7 @@ static HlAttrs ui_client_dict2hlattrs(Dictionary d, bool rgb) } #ifdef INCLUDE_GENERATED_DECLARATIONS -#include "ui_events_client.generated.h" +# include "ui_events_client.generated.h" #endif void ui_client_event_grid_resize(Array args) @@ -210,5 +210,5 @@ void ui_client_event_grid_line(Array args) return; error: - ELOG("Error handling ui event 'grid_line'"); + ELOG("Error handling ui event 'grid_line'"); } diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index 253deecc52..d31341ae60 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -6,8 +6,9 @@ typedef void (*UIClientHandler)(Array args); #ifdef INCLUDE_GENERATED_DECLARATIONS -#include "ui_client.h.generated.h" -#include "ui_events_client.h.generated.h" +# include "ui_client.h.generated.h" + +# include "ui_events_client.h.generated.h" #endif #endif // NVIM_UI_CLIENT_H diff --git a/src/uncrustify.cfg b/src/uncrustify.cfg index 49ce394dc9..c1a5380fb8 100644 --- a/src/uncrustify.cfg +++ b/src/uncrustify.cfg @@ -1,4 +1,4 @@ -# Uncrustify-0.74.0 +# Uncrustify-0.74.0_f # # General options |