This commit is contained in:
Jan Edmund Lazo 2019-05-26 21:45:46 -04:00
parent b2a11515b2
commit 3c3b7844b9
5 changed files with 35 additions and 40 deletions

View File

@ -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);
} }

View File

@ -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
const int ni = !IS_USER_CMDIDX(ea.cmdidx)
&& (cmdnames[ea.cmdidx].cmd_func == ex_ni && (cmdnames[ea.cmdidx].cmd_func == ex_ni
|| cmdnames[ea.cmdidx].cmd_func == ex_script_ni || cmdnames[ea.cmdidx].cmd_func == ex_script_ni);
));
// Forced commands. // Forced commands.

View File

@ -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

View File

@ -541,9 +541,8 @@ 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
flags & NV_NCH && ( return 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

View File

@ -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;