aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2022-05-22 21:20:18 -0600
committerGitHub <noreply@github.com>2022-05-22 21:20:18 -0600
commit9e1ee9fb1d747facb6fa97a32dc5e22c7dfcb346 (patch)
treeb6fe628698f9d4181285a144b17b7518833693ce /src/nvim/getchar.c
parenta7e0a02031c7b4a192cb9c0e4eb13a714d5b0dbb (diff)
downloadrneovim-9e1ee9fb1d747facb6fa97a32dc5e22c7dfcb346.tar.gz
rneovim-9e1ee9fb1d747facb6fa97a32dc5e22c7dfcb346.tar.bz2
rneovim-9e1ee9fb1d747facb6fa97a32dc5e22c7dfcb346.zip
refactor!: delete insertmode (#18547)
Neovim already removed `evim` (or any similar flags). The 'insertmode' option is a weird remnant, so get rid of it. The 'insertmode' option is replaced with a script that closely emulates the option. This script is documented at :help 'insertmode'
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 8881263d1c..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;
}
}
@@ -2513,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;