diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2021-10-19 06:51:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-19 06:51:42 -0700 |
| commit | aac15cf4ade5cb67000abe171ff8e2060b78907e (patch) | |
| tree | cc91a6759c739044a5a338bc938cfa033d7273ac /src | |
| parent | 29b718d04c474433977e952ac7f3561041f3bda0 (diff) | |
| parent | 6059784770c4c88fb6fe528b9f7634192fa1164e (diff) | |
| download | rneovim-aac15cf4ade5cb67000abe171ff8e2060b78907e.tar.gz rneovim-aac15cf4ade5cb67000abe171ff8e2060b78907e.tar.bz2 rneovim-aac15cf4ade5cb67000abe171ff8e2060b78907e.zip | |
Merge #16000 refactor: uncrustify
Diffstat (limited to 'src')
32 files changed, 1339 insertions, 1318 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index ea49222a93..b3a08971e9 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -6216,8 +6216,8 @@ static void internal_format(int textwidth, int second_indent, int flags, int for open_line(FORWARD, OPENLINE_DELSPACES + OPENLINE_MARKFIX + (fo_white_par ? OPENLINE_KEEPTRAIL : 0) + (do_comments ? OPENLINE_DO_COM : 0) - + ((flags & INSCHAR_COM_LIST) ? OPENLINE_COM_LIST : 0) - , ((flags & INSCHAR_COM_LIST) ? second_indent : old_indent)); + + ((flags & INSCHAR_COM_LIST) ? OPENLINE_COM_LIST : 0), + ((flags & INSCHAR_COM_LIST) ? second_indent : old_indent)); if (!(flags & INSCHAR_COM_LIST)) { old_indent = 0; } diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 5c22bf0f8f..946bde060d 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -1963,13 +1963,13 @@ static void f_environ(typval_T *argvars, typval_T *rettv, FunPtr fptr) os_copy_fullenv(env, env_size); for (ssize_t i = env_size - 1; i >= 0; i--) { - const char * str = env[i]; + const char *str = env[i]; const char * const end = strchr(str + (str[0] == '=' ? 1 : 0), '='); assert(end != NULL); ptrdiff_t len = end - str; assert(len > 0); - const char * value = str + len + 1; + const char *value = str + len + 1; char c = env[i][len]; env[i][len] = NUL; @@ -5345,7 +5345,7 @@ static const char *required_env_vars[] = { static dict_T *create_environment(const dictitem_T *job_env, const bool clear_env, const bool pty, const char * const pty_term_name) { - dict_T * env = tv_dict_alloc(); + dict_T *env = tv_dict_alloc(); if (!clear_env) { typval_T temp_env = TV_INITIAL_VALUE; @@ -9644,7 +9644,7 @@ static void f_sign_jump(typval_T *argvars, typval_T *rettv, FunPtr fptr) } // Sign group - const char * sign_group_chk = tv_get_string_chk(&argvars[1]); + const char *sign_group_chk = tv_get_string_chk(&argvars[1]); if (sign_group_chk == NULL) { return; } diff --git a/src/nvim/event/loop.h b/src/nvim/event/loop.h index 03cf7e489a..acd1d1a334 100644 --- a/src/nvim/event/loop.h +++ b/src/nvim/event/loop.h @@ -8,7 +8,7 @@ #include "nvim/lib/klist.h" #include "nvim/os/time.h" -typedef void * WatcherPtr; +typedef void *WatcherPtr; #define _noop(x) KLIST_INIT(WatcherPtr, WatcherPtr, _noop) diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index f649266b9f..4524026e3f 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5697,7 +5697,7 @@ void ex_comclear(exarg_T *eap) uc_clear(&curbuf->b_ucmds); } -static void free_ucmd(ucmd_T * cmd) { +static void free_ucmd(ucmd_T *cmd) { xfree(cmd->uc_name); xfree(cmd->uc_rep); xfree(cmd->uc_compl_arg); @@ -7501,8 +7501,8 @@ void do_exedit(exarg_T *eap, win_T *old_curwin) // After a split we can use an existing buffer. + (old_curwin != NULL ? ECMD_OLDBUF : 0) + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0) - + (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0) - , old_curwin == NULL ? curwin : NULL) == FAIL) { + + (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0), + old_curwin == NULL ? curwin : NULL) == FAIL) { // Editing the file failed. If the window was split, close it. if (old_curwin != NULL) { need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1); diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 9eab579243..fca62353d5 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -642,8 +642,8 @@ char_u *vim_findfile(void *search_ctx_arg) if (stackp->ffs_filearray == NULL && ff_check_visited(&search_ctx->ffsc_dir_visited_list ->ffvl_visited_list, - stackp->ffs_fix_path - , stackp->ffs_wc_path + stackp->ffs_fix_path, + stackp->ffs_wc_path ) == FAIL) { #ifdef FF_VERBOSE if (p_verbose >= 5) { @@ -840,15 +840,15 @@ char_u *vim_findfile(void *search_ctx_arg) == os_isdir(file_path))))) #ifndef FF_VERBOSE && (ff_check_visited(&search_ctx->ffsc_visited_list->ffvl_visited_list, - file_path - , (char_u *)"" + file_path, + (char_u *)"" ) == OK) #endif ) { #ifdef FF_VERBOSE if (ff_check_visited(&search_ctx->ffsc_visited_list->ffvl_visited_list, - file_path - , (char_u *)"" + file_path, + (char_u *)"" ) == FAIL) { if (p_verbose >= 5) { verbose_enter_scroll(); diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index bd78818ab2..4a33d74011 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -3154,8 +3154,8 @@ nobackup: O_WRONLY | (append ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND) - : (O_CREAT | O_TRUNC)) - , perm < 0 ? 0666 : (perm & 0777))) < 0) { + : (O_CREAT | O_TRUNC)), + perm < 0 ? 0666 : (perm & 0777))) < 0) { // A forced write will try to create a new file if the old one // is still readonly. This may also happen when the directory // is read-only. In that case the mch_remove() will fail. @@ -4684,7 +4684,7 @@ int vim_rename(const char_u *from, const char_u *to) } STRCPY(tempname, from); for (n = 123; n < 99999; n++) { - char * tail = (char *)path_tail(tempname); + char *tail = (char *)path_tail(tempname); snprintf(tail, (MAXPATHL + 1) - (tail - (char *)tempname - 1), "%d", n); if (!os_path_exists(tempname)) { diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 99e0bff81c..0b828777f4 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -2438,7 +2438,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit) static int prt_add_resource(struct prt_ps_resource_S *resource) { - FILE * fd_resource; + FILE *fd_resource; char_u resource_buffer[512]; size_t bytes_read; @@ -2696,8 +2696,8 @@ int mch_print_begin(prt_settings_T *psettings) prt_dsc_resources(NULL, "encoding", buffer); } prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate, - psettings->do_syntax - , prt_num_copies); + psettings->do_syntax, + prt_num_copies); prt_dsc_noarg("EndComments"); /* diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index a0e8bad11f..12f2b62313 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -49,62 +49,61 @@ typedef struct attr_entry { /// Values for index in highlight_attr[]. /// When making changes, also update hlf_names below! typedef enum { - HLF_8 = 0 // Meta & special keys listed with ":map", text that is + HLF_8 = 0, // Meta & special keys listed with ":map", text that is // displayed different from what it is - , HLF_EOB // after the last line in the buffer - , HLF_TERM // terminal cursor focused - , HLF_TERMNC // terminal cursor unfocused - , HLF_AT // @ characters at end of screen, characters that - // don't really exist in the text - , HLF_D // directories in CTRL-D listing - , HLF_E // error messages - , HLF_I // incremental search - , HLF_L // last search string - , HLF_M // "--More--" message - , HLF_CM // Mode (e.g., "-- INSERT --") - , HLF_N // line number for ":number" and ":#" commands - , HLF_LNA // LineNrAbove - , HLF_LNB // LineNrBelow - , HLF_CLN // current line number when 'cursorline' is set - , HLF_R // return to continue message and yes/no questions - , HLF_S // status lines - , HLF_SNC // status lines of not-current windows - , HLF_C // column to separate vertically split windows - , HLF_T // Titles for output from ":set all", ":autocmd" etc. - , HLF_V // Visual mode - , HLF_VNC // Visual mode, autoselecting and not clipboard owner - , HLF_W // warning messages - , HLF_WM // Wildmenu highlight - , HLF_FL // Folded line - , HLF_FC // Fold column - , HLF_ADD // Added diff line - , HLF_CHD // Changed diff line - , HLF_DED // Deleted diff line - , HLF_TXD // Text Changed in diff line - , HLF_SC // Sign column - , HLF_CONCEAL // Concealed text - , HLF_SPB // SpellBad - , HLF_SPC // SpellCap - , HLF_SPR // SpellRare - , HLF_SPL // SpellLocal - , HLF_PNI // popup menu normal item - , HLF_PSI // popup menu selected item - , HLF_PSB // popup menu scrollbar - , HLF_PST // popup menu scrollbar thumb - , HLF_TP // tabpage line - , HLF_TPS // tabpage line selected - , HLF_TPF // tabpage line filler - , HLF_CUC // 'cursorcolumn' - , HLF_CUL // 'cursorline' - , HLF_MC // 'colorcolumn' - , HLF_QFL // selected quickfix line - , HLF_0 // Whitespace - , HLF_INACTIVE // NormalNC: Normal text in non-current windows - , HLF_MSGSEP // message separator line - , HLF_NFLOAT // Floating window - , HLF_MSG // Message area - , HLF_BORDER // Floating window border - , HLF_COUNT // MUST be the last one + HLF_EOB, // after the last line in the buffer + HLF_TERM, // terminal cursor focused + HLF_TERMNC, // terminal cursor unfocused + HLF_AT, // @ characters at end of screen, characters that don't really exist in the text + HLF_D, // directories in CTRL-D listing + HLF_E, // error messages + HLF_I, // incremental search + HLF_L, // last search string + HLF_M, // "--More--" message + HLF_CM, // Mode (e.g., "-- INSERT --") + HLF_N, // line number for ":number" and ":#" commands + HLF_LNA, // LineNrAbove + HLF_LNB, // LineNrBelow + HLF_CLN, // current line number when 'cursorline' is set + HLF_R, // return to continue message and yes/no questions + HLF_S, // status lines + HLF_SNC, // status lines of not-current windows + HLF_C, // column to separate vertically split windows + HLF_T, // Titles for output from ":set all", ":autocmd" etc. + HLF_V, // Visual mode + HLF_VNC, // Visual mode, autoselecting and not clipboard owner + HLF_W, // warning messages + HLF_WM, // Wildmenu highlight + HLF_FL, // Folded line + HLF_FC, // Fold column + HLF_ADD, // Added diff line + HLF_CHD, // Changed diff line + HLF_DED, // Deleted diff line + HLF_TXD, // Text Changed in diff line + HLF_SC, // Sign column + HLF_CONCEAL, // Concealed text + HLF_SPB, // SpellBad + HLF_SPC, // SpellCap + HLF_SPR, // SpellRare + HLF_SPL, // SpellLocal + HLF_PNI, // popup menu normal item + HLF_PSI, // popup menu selected item + HLF_PSB, // popup menu scrollbar + HLF_PST, // popup menu scrollbar thumb + HLF_TP, // tabpage line + HLF_TPS, // tabpage line selected + HLF_TPF, // tabpage line filler + HLF_CUC, // 'cursorcolumn' + HLF_CUL, // 'cursorline' + HLF_MC, // 'colorcolumn' + HLF_QFL, // selected quickfix line + HLF_0, // Whitespace + HLF_INACTIVE, // NormalNC: Normal text in non-current windows + HLF_MSGSEP, // message separator line + HLF_NFLOAT, // Floating window + HLF_MSG, // Message area + HLF_BORDER, // Floating window border + HLF_COUNT // MUST be the last one } hlf_T; EXTERN const char *hlf_names[] INIT(= { diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index f236b966ca..d731e79473 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -41,7 +41,7 @@ # include "if_cscope.c.generated.h" #endif -static csinfo_T * csinfo = NULL; +static csinfo_T *csinfo = NULL; static size_t csinfo_size = 0; // number of items allocated in csinfo[] static int eap_arg_len; // length of eap->arg, set in cs_lookup_cmd() diff --git a/src/nvim/if_cscope_defs.h b/src/nvim/if_cscope_defs.h index 39cfd807f9..182cbc28e1 100644 --- a/src/nvim/if_cscope_defs.h +++ b/src/nvim/if_cscope_defs.h @@ -26,17 +26,17 @@ // See ":help cscope-find" for the possible queries. typedef struct { - char * name; + char *name; int (*func)(exarg_T *eap); - char * help; - char * usage; + char *help; + char *usage; int cansplit; // if supports splitting window } cscmd_T; typedef struct csi { - char * fname; // cscope db name - char * ppath; // path to prepend (the -P option) - char * flags; // additional cscope flags/options (e.g, -p2) + char *fname; // cscope db name + char *ppath; // path to prepend (the -P option) + char *flags; // additional cscope flags/options (e.g, -p2) #if defined(UNIX) pid_t pid; // PID of the connected cscope process #else @@ -48,8 +48,8 @@ typedef struct csi { #endif FileID file_id; - FILE * fr_fp; // from cscope: FILE. - FILE * to_fp; // to cscope: FILE. + FILE *fr_fp; // from cscope: FILE. + FILE *to_fp; // to cscope: FILE. } csinfo_T; typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e; diff --git a/src/nvim/keymap.h b/src/nvim/keymap.h index f2de341976..663a7a12ec 100644 --- a/src/nvim/keymap.h +++ b/src/nvim/keymap.h @@ -122,130 +122,130 @@ // // Entries must be in the range 0x02-0x7f (see comment at K_SPECIAL). enum key_extra { - KE_NAME = 3 // name of this terminal entry - - , KE_S_UP = 4 // shift-up - , KE_S_DOWN = 5 // shift-down - - , KE_S_F1 = 6 // shifted function keys - , KE_S_F2 = 7 - , KE_S_F3 = 8 - , KE_S_F4 = 9 - , KE_S_F5 = 10 - , KE_S_F6 = 11 - , KE_S_F7 = 12 - , KE_S_F8 = 13 - , KE_S_F9 = 14 - , KE_S_F10 = 15 - - , KE_S_F11 = 16 - , KE_S_F12 = 17 - , KE_S_F13 = 18 - , KE_S_F14 = 19 - , KE_S_F15 = 20 - , KE_S_F16 = 21 - , KE_S_F17 = 22 - , KE_S_F18 = 23 - , KE_S_F19 = 24 - , KE_S_F20 = 25 - - , KE_S_F21 = 26 - , KE_S_F22 = 27 - , KE_S_F23 = 28 - , KE_S_F24 = 29 - , KE_S_F25 = 30 - , KE_S_F26 = 31 - , KE_S_F27 = 32 - , KE_S_F28 = 33 - , KE_S_F29 = 34 - , KE_S_F30 = 35 - - , KE_S_F31 = 36 - , KE_S_F32 = 37 - , KE_S_F33 = 38 - , KE_S_F34 = 39 - , KE_S_F35 = 40 - , KE_S_F36 = 41 - , KE_S_F37 = 42 - - , KE_MOUSE = 43 // mouse event start - - // Symbols for pseudo keys which are translated from the real key symbols - // above. - , KE_LEFTMOUSE = 44 // Left mouse button click - , KE_LEFTDRAG = 45 // Drag with left mouse button down - , KE_LEFTRELEASE = 46 // Left mouse button release - , KE_MIDDLEMOUSE = 47 // Middle mouse button click - , KE_MIDDLEDRAG = 48 // Drag with middle mouse button down - , KE_MIDDLERELEASE = 49 // Middle mouse button release - , KE_RIGHTMOUSE = 50 // Right mouse button click - , KE_RIGHTDRAG = 51 // Drag with right mouse button down - , KE_RIGHTRELEASE = 52 // Right mouse button release - - , KE_IGNORE = 53 // Ignored mouse drag/release - - , KE_TAB = 54 // unshifted TAB key - , KE_S_TAB_OLD = 55 // shifted TAB key (no longer used) - - // , KE_SNIFF_UNUSED = 56 // obsolete - , KE_XF1 = 57 // extra vt100 function keys for xterm - , KE_XF2 = 58 - , KE_XF3 = 59 - , KE_XF4 = 60 - , KE_XEND = 61 // extra (vt100) end key for xterm - , KE_ZEND = 62 // extra (vt100) end key for xterm - , KE_XHOME = 63 // extra (vt100) home key for xterm - , KE_ZHOME = 64 // extra (vt100) home key for xterm - , KE_XUP = 65 // extra vt100 cursor keys for xterm - , KE_XDOWN = 66 - , KE_XLEFT = 67 - , KE_XRIGHT = 68 - - , KE_LEFTMOUSE_NM = 69 // non-mappable Left mouse button click - , KE_LEFTRELEASE_NM = 70 // non-mappable left mouse button release - - , KE_S_XF1 = 71 // vt100 shifted function keys for xterm - , KE_S_XF2 = 72 - , KE_S_XF3 = 73 - , KE_S_XF4 = 74 - - // NOTE: The scroll wheel events are inverted: i.e. UP is the same as - // moving the actual scroll wheel down, LEFT is the same as moving the - // scroll wheel right. - , KE_MOUSEDOWN = 75 // scroll wheel pseudo-button Down - , KE_MOUSEUP = 76 // scroll wheel pseudo-button Up - , KE_MOUSELEFT = 77 // scroll wheel pseudo-button Left - , KE_MOUSERIGHT = 78 // scroll wheel pseudo-button Right - - , KE_KINS = 79 // keypad Insert key - , KE_KDEL = 80 // keypad Delete key - - , KE_CSI = 81 // CSI typed directly - , KE_SNR = 82 // <SNR> - , KE_PLUG = 83 // <Plug> - , KE_CMDWIN = 84 // open command-line window from Command-line Mode - - , KE_C_LEFT = 85 // control-left - , KE_C_RIGHT = 86 // control-right - , KE_C_HOME = 87 // control-home - , KE_C_END = 88 // control-end - - , KE_X1MOUSE = 89 // X1/X2 mouse-buttons - , KE_X1DRAG = 90 - , KE_X1RELEASE = 91 - , KE_X2MOUSE = 92 - , KE_X2DRAG = 93 - , KE_X2RELEASE = 94 - - , KE_DROP = 95 // DnD data is available - // , KE_CURSORHOLD = 96 // CursorHold event - , KE_NOP = 97 // no-op: does nothing - // , KE_FOCUSGAINED = 98 // focus gained - // , KE_FOCUSLOST = 99 // focus lost - , KE_MOUSEMOVE = 100 // mouse moved with no button down - // , KE_CANCEL = 101 // return from vgetc - , KE_EVENT = 102 // event - , KE_COMMAND = 104 // <Cmd> special key + KE_NAME = 3, // name of this terminal entry + + KE_S_UP = 4, // shift-up + KE_S_DOWN = 5, // shift-down + + KE_S_F1 = 6, // shifted function keys + KE_S_F2 = 7, + KE_S_F3 = 8, + KE_S_F4 = 9, + KE_S_F5 = 10, + KE_S_F6 = 11, + KE_S_F7 = 12, + KE_S_F8 = 13, + KE_S_F9 = 14, + KE_S_F10 = 15, + + KE_S_F11 = 16, + KE_S_F12 = 17, + KE_S_F13 = 18, + KE_S_F14 = 19, + KE_S_F15 = 20, + KE_S_F16 = 21, + KE_S_F17 = 22, + KE_S_F18 = 23, + KE_S_F19 = 24, + KE_S_F20 = 25, + + KE_S_F21 = 26, + KE_S_F22 = 27, + KE_S_F23 = 28, + KE_S_F24 = 29, + KE_S_F25 = 30, + KE_S_F26 = 31, + KE_S_F27 = 32, + KE_S_F28 = 33, + KE_S_F29 = 34, + KE_S_F30 = 35, + + KE_S_F31 = 36, + KE_S_F32 = 37, + KE_S_F33 = 38, + KE_S_F34 = 39, + KE_S_F35 = 40, + KE_S_F36 = 41, + KE_S_F37 = 42, + + KE_MOUSE = 43, // mouse event start + + // Symbols for pseudo keys which are translated from the real key symbols + // above. + KE_LEFTMOUSE = 44, // Left mouse button click + KE_LEFTDRAG = 45, // Drag with left mouse button down + KE_LEFTRELEASE = 46, // Left mouse button release + KE_MIDDLEMOUSE = 47, // Middle mouse button click + KE_MIDDLEDRAG = 48, // Drag with middle mouse button down + KE_MIDDLERELEASE = 49, // Middle mouse button release + KE_RIGHTMOUSE = 50, // Right mouse button click + KE_RIGHTDRAG = 51, // Drag with right mouse button down + KE_RIGHTRELEASE = 52, // Right mouse button release + + KE_IGNORE = 53, // Ignored mouse drag/release + + KE_TAB = 54, // unshifted TAB key + KE_S_TAB_OLD = 55, // shifted TAB key (no longer used) + + // , KE_SNIFF_UNUSED = 56 // obsolete + KE_XF1 = 57, // extra vt100 function keys for xterm + KE_XF2 = 58, + KE_XF3 = 59, + KE_XF4 = 60, + KE_XEND = 61, // extra (vt100) end key for xterm + KE_ZEND = 62, // extra (vt100) end key for xterm + KE_XHOME = 63, // extra (vt100) home key for xterm + KE_ZHOME = 64, // extra (vt100) home key for xterm + KE_XUP = 65, // extra vt100 cursor keys for xterm + KE_XDOWN = 66, + KE_XLEFT = 67, + KE_XRIGHT = 68, + + KE_LEFTMOUSE_NM = 69, // non-mappable Left mouse button click + KE_LEFTRELEASE_NM = 70, // non-mappable left mouse button release + + KE_S_XF1 = 71, // vt100 shifted function keys for xterm + KE_S_XF2 = 72, + KE_S_XF3 = 73, + KE_S_XF4 = 74, + + // NOTE: The scroll wheel events are inverted: i.e. UP is the same as + // moving the actual scroll wheel down, LEFT is the same as moving the + // scroll wheel right. + KE_MOUSEDOWN = 75, // scroll wheel pseudo-button Down + KE_MOUSEUP = 76, // scroll wheel pseudo-button Up + KE_MOUSELEFT = 77, // scroll wheel pseudo-button Left + KE_MOUSERIGHT = 78, // scroll wheel pseudo-button Right + + KE_KINS = 79, // keypad Insert key + KE_KDEL = 80, // keypad Delete key + + KE_CSI = 81, // CSI typed directly + KE_SNR = 82, // <SNR> + KE_PLUG = 83, // <Plug> + KE_CMDWIN = 84, // open command-line window from Command-line Mode + + KE_C_LEFT = 85, // control-left + KE_C_RIGHT = 86, // control-right + KE_C_HOME = 87, // control-home + KE_C_END = 88, // control-end + + KE_X1MOUSE = 89, // X1/X2 mouse-buttons + KE_X1DRAG = 90, + KE_X1RELEASE = 91, + KE_X2MOUSE = 92, + KE_X2DRAG = 93, + KE_X2RELEASE = 94, + + KE_DROP = 95, // DnD data is available + // , KE_CURSORHOLD = 96 // CursorHold event + KE_NOP = 97, // no-op: does nothing + // , KE_FOCUSGAINED = 98 // focus gained + // , KE_FOCUSLOST = 99 // focus lost + KE_MOUSEMOVE = 100, // mouse moved with no button down + // , KE_CANCEL = 101 // return from vgetc + KE_EVENT = 102, // event + KE_COMMAND = 104 // <Cmd> special key }; /* diff --git a/src/nvim/lib/kbtree.h b/src/nvim/lib/kbtree.h index 6b10db0bbc..e2a4e9edea 100644 --- a/src/nvim/lib/kbtree.h +++ b/src/nvim/lib/kbtree.h @@ -1,5 +1,3 @@ -// uncrustify:off - /*- * Copyright 1997-1999, 2001, John-Mark Gurney. * 2008-2009, Attractive Chaos <attractor@live.co.uk> @@ -36,386 +34,419 @@ #ifndef NVIM_LIB_KBTREE_H #define NVIM_LIB_KBTREE_H +#include <assert.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> -#include <stdint.h> -#include <assert.h> #include "nvim/memory.h" #define KB_MAX_DEPTH 64 -#define __KB_KEY(type, x) (x->key) -#define __KB_PTR(btr, x) (x->ptr) +#define __KB_KEY(type, x) (x->key) +#define __KB_PTR(btr, x) (x->ptr) -#define __KB_TREE_T(name,key_t,T) \ - typedef struct kbnode_##name##_s kbnode_##name##_t; \ - struct kbnode_##name##_s { \ - int32_t n; \ - bool is_internal; \ - key_t key[2*T-1]; \ - kbnode_##name##_t *ptr[]; \ - } ; \ +#define __KB_TREE_T(name, key_t, T) \ + typedef struct kbnode_##name##_s kbnode_##name##_t; \ + struct kbnode_##name##_s { \ + int32_t n; \ + bool is_internal; \ + key_t key[2*T-1]; \ + kbnode_##name##_t *ptr[]; \ + } ; \ \ - typedef struct { \ - kbnode_##name##_t *root; \ - int n_keys, n_nodes; \ - } kbtree_##name##_t; \ + typedef struct { \ + kbnode_##name##_t *root; \ + int n_keys, n_nodes; \ + } kbtree_##name##_t; \ \ - typedef struct { \ - kbnode_##name##_t *x; \ - int i; \ - } kbpos_##name##_t; \ - typedef struct { \ - kbpos_##name##_t stack[KB_MAX_DEPTH], *p; \ - } kbitr_##name##_t; \ + typedef struct { \ + kbnode_##name##_t *x; \ + int i; \ + } kbpos_##name##_t; \ + typedef struct { \ + kbpos_##name##_t stack[KB_MAX_DEPTH], *p; \ + } kbitr_##name##_t; \ -#define __kb_destroy(kbnode_t,b) do { \ - int i; \ - unsigned int max = 8; \ - kbnode_t *x, **top, **stack = 0; \ - if (b->root) { \ - top = stack = (kbnode_t**)xcalloc(max, sizeof(kbnode_t*)); \ - *top++ = (b)->root; \ - while (top != stack) { \ - x = *--top; \ - if (x->is_internal == 0) { XFREE_CLEAR(x); continue; } \ - for (i = 0; i <= x->n; ++i) \ - if (__KB_PTR(b, x)[i]) { \ - if (top - stack == (int)max) { \ - max <<= 1; \ - stack = (kbnode_t**)xrealloc(stack, max * sizeof(kbnode_t*)); \ - top = stack + (max>>1); \ - } \ - *top++ = __KB_PTR(b, x)[i]; \ - } \ - XFREE_CLEAR(x); \ - } \ - } \ - XFREE_CLEAR(stack); \ - } while (0) +#define __kb_destroy(kbnode_t, b) do { \ + int i; \ + unsigned int max = 8; \ + kbnode_t *x, **top, **stack = 0; \ + if (b->root) { \ + top = stack = (kbnode_t **)xcalloc(max, sizeof(kbnode_t *)); \ + *top++ = (b)->root; \ + while (top != stack) { \ + x = *--top; \ + if (x->is_internal == 0) { XFREE_CLEAR(x); continue; } \ + for (i = 0; i <= x->n; ++i) \ + if (__KB_PTR(b, x)[i]) { \ + if (top - stack == (int)max) { \ + max <<= 1; \ + stack = (kbnode_t **)xrealloc(stack, max * sizeof(kbnode_t *)); \ + top = stack + (max>>1); |