diff options
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index ccf7dd0f68..52da7fe4f6 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -317,7 +317,9 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, int count = 0; /* line number count */ int did_inc = FALSE; /* incremented RedrawingDisabled */ int retval = OK; - cstack_T cstack; // conditional stack + cstack_T cstack = { // conditional stack + .cs_idx = -1, + }; garray_T lines_ga; // keep lines for ":while"/":for" int current_line = 0; // active line in lines_ga char_u *fname = NULL; // function or script name @@ -360,11 +362,6 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, call_depth++; start_batch_changes(); - cstack.cs_idx = -1; - cstack.cs_looplevel = 0; - cstack.cs_trylevel = 0; - cstack.cs_emsg_silent_list = NULL; - cstack.cs_lflags = 0; ga_init(&lines_ga, (int)sizeof(wcmd_T), 10); real_cookie = getline_cookie(fgetline, cookie); @@ -3041,9 +3038,10 @@ const char * set_one_cmd_context( p = arg + 1; arg = (const char *)skip_cmd_arg((char_u *)arg, false); - /* Still touching the command after '+'? */ - if (*arg == NUL) + // Still touching the command after '+'? + if (*arg == NUL) { return p; + } // Skip space(s) after +command to get to the real argument. arg = (const char *)skipwhite((const char_u *)arg); @@ -3680,6 +3678,10 @@ const char * set_one_cmd_context( xp->xp_pattern = (char_u *)arg; break; + case CMD_lua: + xp->xp_context = EXPAND_LUA; + break; + default: break; } @@ -3968,7 +3970,7 @@ static linenr_T get_address(exarg_T *eap, break; default: - if (ascii_isdigit(*cmd)) { // absolute line number + if (ascii_isdigit(*cmd)) { // absolute line number lnum = getdigits_long(&cmd, false, 0); } } @@ -5187,6 +5189,7 @@ static const char *command_complete[] = #ifdef HAVE_WORKING_LIBINTL [EXPAND_LOCALES] = "locale", #endif + [EXPAND_LUA] = "lua", [EXPAND_MAPCLEAR] = "mapclear", [EXPAND_MAPPINGS] = "mapping", [EXPAND_MENUS] = "menu", @@ -5400,8 +5403,8 @@ static int uc_scan_attr(char_u *attr, size_t len, uint32_t *argt, long *def, size_t vallen = 0; size_t attrlen = len; - /* Look for the attribute name - which is the part before any '=' */ - for (i = 0; i < (int)len; ++i) { + // Look for the attribute name - which is the part before any '=' + for (i = 0; i < (int)len; i++) { if (attr[i] == '=') { val = &attr[i + 1]; vallen = len - i - 1; @@ -7503,8 +7506,9 @@ static void ex_read(exarg_T *eap) } if (*eap->arg == NUL) { - if (check_fname() == FAIL) /* check for no file name */ + if (check_fname() == FAIL) { // check for no file name return; + } i = readfile(curbuf->b_ffname, curbuf->b_fname, eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0); } else { @@ -7587,7 +7591,7 @@ void post_chdir(CdScope scope, bool trigger_dirchanged) curwin->w_localdir = (char_u *)xstrdup(cwd); break; case kCdScopeInvalid: - assert(false); + abort(); } shorten_fnames(true); |