diff options
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 2a29450295..72d39adb3e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -2064,10 +2064,10 @@ static char_u * do_one_cmd(char_u **cmdlinep, } } - /* - * Check for a count. When accepting a BUFNAME, don't use "123foo" as a - * count, it's a buffer name. - */ + // + // Check for a count. When accepting a BUFNAME, don't use "123foo" as a + // count, it's a buffer name. + /// if ((ea.argt & COUNT) && ascii_isdigit(*ea.arg) && (!(ea.argt & BUFNAME) || *(p = skipdigits(ea.arg)) == NUL || ascii_iswhite(*p))) { @@ -3796,14 +3796,16 @@ 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); + } } for (;; ) { cmd = skipwhite(cmd); - if (*cmd != '-' && *cmd != '+' && !ascii_isdigit(*cmd)) + if (*cmd != '-' && *cmd != '+' && !ascii_isdigit(*cmd)) { break; + } if (lnum == MAXLNUM) { switch (addr_type) { @@ -7723,17 +7725,13 @@ static void ex_rundo(exarg_T *eap) u_read_undo((char *) eap->arg, hash, NULL); } -/* - * ":redo". - */ +/// ":redo". static void ex_redo(exarg_T *eap) { u_redo(1); } -/* - * ":earlier" and ":later". - */ +/// ":earlier" and ":later". static void ex_later(exarg_T *eap) { long count = 0; @@ -7741,9 +7739,9 @@ static void ex_later(exarg_T *eap) bool file = false; char_u *p = eap->arg; - if (*p == NUL) + if (*p == NUL) { count = 1; - else if (isdigit(*p)) { + } else if (isdigit(*p)) { count = getdigits_long(&p, false, 0); switch (*p) { case 's': ++p; sec = true; break; @@ -7754,11 +7752,12 @@ static void ex_later(exarg_T *eap) } } - if (*p != NUL) + if (*p != NUL) { EMSG2(_(e_invarg2), eap->arg); - else + } else { undo_time(eap->cmdidx == CMD_earlier ? -count : count, sec, file, false); + } } /* @@ -8412,23 +8411,24 @@ static void ex_findpat(exarg_T *eap) } n = 1; - if (ascii_isdigit(*eap->arg)) { /* get count */ + if (ascii_isdigit(*eap->arg)) { // get count n = getdigits_long(&eap->arg, false, 0); eap->arg = skipwhite(eap->arg); } - if (*eap->arg == '/') { /* Match regexp, not just whole words */ - whole = FALSE; - ++eap->arg; + if (*eap->arg == '/') { // Match regexp, not just whole words + whole = false; + eap->arg++; p = skip_regexp(eap->arg, '/', p_magic, NULL); if (*p) { *p++ = NUL; p = skipwhite(p); - /* Check for trailing illegal characters */ - if (!ends_excmd(*p)) + // Check for trailing illegal characters. + if (!ends_excmd(*p)) { eap->errmsg = e_trailing; - else + } else { eap->nextcmd = check_nextcmd(p); + } } } if (!eap->skip) @@ -8658,7 +8658,6 @@ eval_vars ( *errormsg = (char_u *)""; return NULL; } - } // // '#': Alternate file name // '%': Current file name @@ -8666,9 +8665,9 @@ eval_vars ( // File name for autocommand // and following modifiers // - else { + } else { switch (spec_idx) { - case SPEC_PERC: /* '%': current file */ + case SPEC_PERC: // '%': current file if (curbuf->b_fname == NULL) { result = (char_u *)""; valid = 0; // Must have ":p:h" to be valid @@ -8689,8 +8688,9 @@ eval_vars ( break; } s = src + 1; - if (*s == '<') /* "#<99" uses v:oldfiles */ - ++s; + if (*s == '<') { // "#<99" uses v:oldfiles. + s++; + } i = getdigits_int(&s, false, 0); if (s == src + 2 && src[1] == '-') { // just a minus sign, don't skip over it |