mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
lint
This commit is contained in:
parent
b2a11515b2
commit
3c3b7844b9
@ -13558,9 +13558,8 @@ static void f_readfile(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
|
|
||||||
static void return_register(int regname, typval_T *rettv)
|
static void return_register(int regname, typval_T *rettv)
|
||||||
{
|
{
|
||||||
char_u buf[2] = {0, 0};
|
char_u buf[2] = { regname, 0 };
|
||||||
|
|
||||||
buf[0] = (char_u)regname;
|
|
||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
rettv->vval.v_string = vim_strsave(buf);
|
rettv->vval.v_string = vim_strsave(buf);
|
||||||
}
|
}
|
||||||
|
@ -1234,7 +1234,6 @@ static char_u * do_one_cmd(char_u **cmdlinep,
|
|||||||
int did_sandbox = FALSE;
|
int did_sandbox = FALSE;
|
||||||
cmdmod_T save_cmdmod;
|
cmdmod_T save_cmdmod;
|
||||||
const int save_reg_executing = reg_executing;
|
const int save_reg_executing = reg_executing;
|
||||||
int ni; /* set when Not Implemented */
|
|
||||||
char_u *cmd;
|
char_u *cmd;
|
||||||
int address_count = 1;
|
int address_count = 1;
|
||||||
|
|
||||||
@ -1763,10 +1762,10 @@ static char_u * do_one_cmd(char_u **cmdlinep,
|
|||||||
goto doend;
|
goto doend;
|
||||||
}
|
}
|
||||||
|
|
||||||
ni = (!IS_USER_CMDIDX(ea.cmdidx)
|
// set when Not Implemented
|
||||||
&& (cmdnames[ea.cmdidx].cmd_func == ex_ni
|
const int ni = !IS_USER_CMDIDX(ea.cmdidx)
|
||||||
|| cmdnames[ea.cmdidx].cmd_func == ex_script_ni
|
&& (cmdnames[ea.cmdidx].cmd_func == ex_ni
|
||||||
));
|
|| cmdnames[ea.cmdidx].cmd_func == ex_script_ni);
|
||||||
|
|
||||||
|
|
||||||
// Forced commands.
|
// Forced commands.
|
||||||
|
@ -1666,8 +1666,9 @@ static int vgetorpeek(int advance)
|
|||||||
|
|
||||||
init_typebuf();
|
init_typebuf();
|
||||||
start_stuff();
|
start_stuff();
|
||||||
if (advance && typebuf.tb_maplen == 0)
|
if (advance && typebuf.tb_maplen == 0) {
|
||||||
reg_executing = 0;
|
reg_executing = 0;
|
||||||
|
}
|
||||||
do {
|
do {
|
||||||
/*
|
/*
|
||||||
* get a character: 1. from the stuffbuffer
|
* get a character: 1. from the stuffbuffer
|
||||||
|
@ -541,30 +541,29 @@ static bool normal_need_additional_char(NormalState *s)
|
|||||||
int flags = nv_cmds[s->idx].cmd_flags;
|
int flags = nv_cmds[s->idx].cmd_flags;
|
||||||
bool pending_op = s->oa.op_type != OP_NOP;
|
bool pending_op = s->oa.op_type != OP_NOP;
|
||||||
int cmdchar = s->ca.cmdchar;
|
int cmdchar = s->ca.cmdchar;
|
||||||
return
|
// without NV_NCH we never need to check for an additional char
|
||||||
// without NV_NCH we never need to check for an additional char
|
return flags & NV_NCH && (
|
||||||
flags & NV_NCH && (
|
// NV_NCH_NOP is set and no operator is pending, get a second char
|
||||||
// NV_NCH_NOP is set and no operator is pending, get a second char
|
((flags & NV_NCH_NOP) == NV_NCH_NOP && !pending_op)
|
||||||
((flags & NV_NCH_NOP) == NV_NCH_NOP && !pending_op)
|
// NV_NCH_ALW is set, always get a second char
|
||||||
// NV_NCH_ALW is set, always get a second char
|
|| (flags & NV_NCH_ALW) == NV_NCH_ALW
|
||||||
|| (flags & NV_NCH_ALW) == NV_NCH_ALW
|
// 'q' without a pending operator, recording or executing a register,
|
||||||
// 'q' without a pending operator, recording or executing a register,
|
// needs to be followed by a second char, examples:
|
||||||
// needs to be followed by a second char, examples:
|
// - qc => record using register c
|
||||||
// - qc => record using register c
|
// - q: => open command-line window
|
||||||
// - q: => open command-line window
|
|| (cmdchar == 'q'
|
||||||
|| (cmdchar == 'q'
|
&& !pending_op
|
||||||
&& !pending_op
|
&& reg_recording == 0
|
||||||
&& reg_recording == 0
|
&& reg_executing == 0)
|
||||||
&& reg_executing == 0)
|
// 'a' or 'i' after an operator is a text object, examples:
|
||||||
// 'a' or 'i' after an operator is a text object, examples:
|
// - ciw => change inside word
|
||||||
// - ciw => change inside word
|
// - da( => delete parenthesis and everything inside.
|
||||||
// - da( => delete parenthesis and everything inside.
|
// Also, don't do anything when these keys are received in visual mode
|
||||||
// Also, don't do anything when these keys are received in visual mode
|
// so just get another char.
|
||||||
// so just get another char.
|
//
|
||||||
//
|
// TODO(tarruda): Visual state needs to be refactored into a
|
||||||
// TODO(tarruda): Visual state needs to be refactored into a
|
// separate state that "inherits" from normal state.
|
||||||
// separate state that "inherits" from normal state.
|
|| ((cmdchar == 'a' || cmdchar == 'i') && (pending_op || VIsual_active)));
|
||||||
|| ((cmdchar == 'a' || cmdchar == 'i') && (pending_op || VIsual_active)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool normal_need_redraw_mode_message(NormalState *s)
|
static bool normal_need_redraw_mode_message(NormalState *s)
|
||||||
|
@ -6410,14 +6410,11 @@ int showmode(void)
|
|||||||
&& ((State & TERM_FOCUS)
|
&& ((State & TERM_FOCUS)
|
||||||
|| (State & INSERT)
|
|| (State & INSERT)
|
||||||
|| restart_edit
|
|| restart_edit
|
||||||
|| VIsual_active
|
|| VIsual_active));
|
||||||
));
|
|
||||||
if (do_mode || reg_recording != 0) {
|
if (do_mode || reg_recording != 0) {
|
||||||
/*
|
// Don't show mode right now, when not redrawing or inside a mapping.
|
||||||
* Don't show mode right now, when not redrawing or inside a mapping.
|
// Call char_avail() only when we are going to show something, because
|
||||||
* Call char_avail() only when we are going to show something, because
|
// it takes a bit of time.
|
||||||
* it takes a bit of time.
|
|
||||||
*/
|
|
||||||
if (!redrawing() || (char_avail() && !KeyTyped) || msg_silent != 0) {
|
if (!redrawing() || (char_avail() && !KeyTyped) || msg_silent != 0) {
|
||||||
redraw_cmdline = TRUE; /* show mode later */
|
redraw_cmdline = TRUE; /* show mode later */
|
||||||
return 0;
|
return 0;
|
||||||
@ -6534,7 +6531,7 @@ int showmode(void)
|
|||||||
need_clear = TRUE;
|
need_clear = TRUE;
|
||||||
}
|
}
|
||||||
if (reg_recording != 0
|
if (reg_recording != 0
|
||||||
&& edit_submode == NULL /* otherwise it gets too long */
|
&& edit_submode == NULL // otherwise it gets too long
|
||||||
) {
|
) {
|
||||||
recording_mode(attr);
|
recording_mode(attr);
|
||||||
need_clear = true;
|
need_clear = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user