mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
lint
This commit is contained in:
parent
7482aef113
commit
0223c81457
@ -2786,9 +2786,9 @@ const char * set_one_cmd_context(
|
||||
|
||||
xp->xp_context = EXPAND_NOTHING; /* Default now that we're past command */
|
||||
|
||||
if (*p == '!') { /* forced commands */
|
||||
if (*p == '!') { // forced commands
|
||||
forceit = true;
|
||||
++p;
|
||||
p++;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2813,9 +2813,9 @@ const char * set_one_cmd_context(
|
||||
}
|
||||
|
||||
if (ea.cmdidx == CMD_read) {
|
||||
usefilter = forceit; /* :r! filter if forced */
|
||||
if (*arg == '!') { /* :r !filter */
|
||||
++arg;
|
||||
usefilter = forceit; // :r! filter if forced
|
||||
if (*arg == '!') { // :r !filter
|
||||
arg++;
|
||||
usefilter = true;
|
||||
}
|
||||
}
|
||||
@ -8393,23 +8393,23 @@ ssize_t find_cmdline_var(const char_u *src, size_t *usedlen)
|
||||
#define SPEC_PERC 0
|
||||
"#",
|
||||
#define SPEC_HASH (SPEC_PERC + 1)
|
||||
"<cword>", /* cursor word */
|
||||
"<cword>", // cursor word
|
||||
#define SPEC_CWORD (SPEC_HASH + 1)
|
||||
"<cWORD>", /* cursor WORD */
|
||||
"<cWORD>", // cursor WORD
|
||||
#define SPEC_CCWORD (SPEC_CWORD + 1)
|
||||
"<cexpr>", // expr under cursor
|
||||
#define SPEC_CEXPR (SPEC_CCWORD + 1)
|
||||
"<cfile>", /* cursor path name */
|
||||
"<cfile>", // cursor path name
|
||||
#define SPEC_CFILE (SPEC_CEXPR + 1)
|
||||
"<sfile>", /* ":so" file name */
|
||||
"<sfile>", // ":so" file name
|
||||
#define SPEC_SFILE (SPEC_CFILE + 1)
|
||||
"<slnum>", /* ":so" file line number */
|
||||
"<slnum>", // ":so" file line number
|
||||
#define SPEC_SLNUM (SPEC_SFILE + 1)
|
||||
"<afile>", /* autocommand file name */
|
||||
"<afile>", // autocommand file name
|
||||
#define SPEC_AFILE (SPEC_SLNUM + 1)
|
||||
"<abuf>", /* autocommand buffer number */
|
||||
"<abuf>", // autocommand buffer number
|
||||
#define SPEC_ABUF (SPEC_AFILE + 1)
|
||||
"<amatch>", /* autocommand match name */
|
||||
"<amatch>", // autocommand match name
|
||||
#define SPEC_AMATCH (SPEC_ABUF + 1)
|
||||
};
|
||||
|
||||
@ -8541,7 +8541,7 @@ eval_vars (
|
||||
// just a minus sign, don't skip over it
|
||||
s--;
|
||||
}
|
||||
*usedlen = (size_t)(s - src); /* length of what we expand */
|
||||
*usedlen = (size_t)(s - src); // length of what we expand
|
||||
|
||||
if (src[1] == '<' && i != 0) {
|
||||
if (*usedlen < 2) {
|
||||
|
@ -3309,9 +3309,9 @@ static bool cmdline_paste(int regname, bool literally, bool remcr)
|
||||
/* Need to save and restore ccline. And set "textlock" to avoid nasty
|
||||
* things like going to another buffer when evaluating an expression. */
|
||||
save_cmdline(&save_ccline);
|
||||
++textlock;
|
||||
textlock++;
|
||||
const bool i = get_spec_reg(regname, &arg, &allocated, true);
|
||||
--textlock;
|
||||
textlock--;
|
||||
restore_cmdline(&save_ccline);
|
||||
|
||||
if (i) {
|
||||
|
@ -3129,13 +3129,12 @@ size_t find_ident_at_pos(win_T *wp, linenr_T lnum, colnr_T startcol,
|
||||
}
|
||||
|
||||
if (ptr[col] == NUL || (i == 0 && this_class != 2)) {
|
||||
/*
|
||||
* didn't find an identifier or string
|
||||
*/
|
||||
if (find_type & FIND_STRING)
|
||||
// didn't find an identifier or string
|
||||
if (find_type & FIND_STRING) {
|
||||
EMSG(_("E348: No string under cursor"));
|
||||
else
|
||||
} else {
|
||||
EMSG(_(e_noident));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
ptr += col;
|
||||
|
@ -1207,8 +1207,8 @@ bool get_spec_reg(
|
||||
*argp = curbuf->b_fname;
|
||||
return true;
|
||||
|
||||
case '#': /* alternate file name */
|
||||
*argp = getaltfname(errmsg); /* may give emsg if not set */
|
||||
case '#': // alternate file name
|
||||
*argp = getaltfname(errmsg); // may give emsg if not set
|
||||
return true;
|
||||
|
||||
case '=': /* result of expression */
|
||||
@ -1231,22 +1231,24 @@ bool get_spec_reg(
|
||||
case '.': /* last inserted text */
|
||||
*argp = get_last_insert_save();
|
||||
*allocated = true;
|
||||
if (*argp == NULL && errmsg)
|
||||
if (*argp == NULL && errmsg) {
|
||||
EMSG(_(e_noinstext));
|
||||
}
|
||||
return true;
|
||||
|
||||
case Ctrl_F: /* Filename under cursor */
|
||||
case Ctrl_P: /* Path under cursor, expand via "path" */
|
||||
case Ctrl_F: // Filename under cursor
|
||||
case Ctrl_P: // Path under cursor, expand via "path"
|
||||
if (!errmsg) {
|
||||
return false;
|
||||
}
|
||||
*argp = file_name_at_cursor(FNAME_MESS | FNAME_HYP
|
||||
| (regname == Ctrl_P ? FNAME_EXP : 0), 1L, NULL);
|
||||
*argp = file_name_at_cursor(
|
||||
FNAME_MESS | FNAME_HYP | (regname == Ctrl_P ? FNAME_EXP : 0),
|
||||
1L, NULL);
|
||||
*allocated = true;
|
||||
return true;
|
||||
|
||||
case Ctrl_W: /* word under cursor */
|
||||
case Ctrl_A: /* WORD (mnemonic All) under cursor */
|
||||
case Ctrl_W: // word under cursor
|
||||
case Ctrl_A: // WORD (mnemonic All) under cursor
|
||||
if (!errmsg) {
|
||||
return false;
|
||||
}
|
||||
@ -2757,8 +2759,9 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
|
||||
* ':' (last command line), etc. we have to create a fake yank register.
|
||||
*/
|
||||
if (get_spec_reg(regname, &insert_string, &allocated, true)) {
|
||||
if (insert_string == NULL)
|
||||
if (insert_string == NULL) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!curbuf->terminal) {
|
||||
@ -4917,8 +4920,9 @@ void *get_reg_contents(int regname, int flags)
|
||||
char_u *retval;
|
||||
bool allocated;
|
||||
if (get_spec_reg(regname, &retval, &allocated, false)) {
|
||||
if (retval == NULL)
|
||||
if (retval == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
if (allocated) {
|
||||
return get_reg_wrap_one_line(retval, flags);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user