diff options
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 2cc068b30d..005415514c 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1352,14 +1352,12 @@ void openscript(char_u *name, bool directly) int oldcurscript; int save_State = State; int save_restart_edit = restart_edit; - int save_insertmode = p_im; int save_finish_op = finish_op; int save_msg_scroll = msg_scroll; State = MODE_NORMAL; msg_scroll = false; // no msg scrolling in Normal mode restart_edit = 0; // don't go to Insert mode - p_im = false; // don't use 'insertmode' clear_oparg(&oa); finish_op = false; @@ -1373,7 +1371,6 @@ void openscript(char_u *name, bool directly) State = save_State; msg_scroll = save_msg_scroll; restart_edit = save_restart_edit; - p_im = save_insertmode; finish_op = save_finish_op; } } @@ -1881,8 +1878,7 @@ static int handle_mapping(int *keylenp, bool *timedout, int *mapdepth) if (no_mapping == 0 && maphash_valid && (no_zero_mapping == 0 || tb_c1 != '0') && (typebuf.tb_maplen == 0 || is_plug_map - || (p_remap - && !(typebuf.tb_noremap[typebuf.tb_off] & (RM_NONE|RM_ABBR)))) + || (!(typebuf.tb_noremap[typebuf.tb_off] & (RM_NONE|RM_ABBR)))) && !(p_paste && (State & (MODE_INSERT | MODE_CMDLINE))) && !(State == MODE_HITRETURN && (tb_c1 == CAR || tb_c1 == ' ')) && State != MODE_ASKMORE @@ -2514,16 +2510,12 @@ static int vgetorpeek(bool advance) timedout = true; continue; } - // When 'insertmode' is set, ESC just beeps in Insert - // mode. Use CTRL-L to make edit() return. // In Ex-mode \n is compatible with original Vim behaviour. // For the command line only CTRL-C always breaks it. // For the cmdline window: Alternate between ESC and // CTRL-C: ESC for most situations and CTRL-C to close the // cmdline window. - if (p_im && (State & MODE_INSERT)) { - c = Ctrl_L; - } else if ((State & MODE_CMDLINE) || (cmdwin_type > 0 && tc == ESC)) { + if ((State & MODE_CMDLINE) || (cmdwin_type > 0 && tc == ESC)) { c = Ctrl_C; } else { c = ESC; |