diff options
author | matveyt <matthewtarasov@gmail.com> | 2021-07-23 18:06:01 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2021-07-23 18:08:40 +0200 |
commit | 8ce092941862a18a6591f62f398ed9e8bd9202be (patch) | |
tree | 431fefdeba54043f46cca1a367ce1735983ade8e /src/nvim/getchar.c | |
parent | 6f48c018b526a776e38e94f58769c30141de9e0c (diff) | |
download | rneovim-8ce092941862a18a6591f62f398ed9e8bd9202be.tar.gz rneovim-8ce092941862a18a6591f62f398ed9e8bd9202be.tar.bz2 rneovim-8ce092941862a18a6591f62f398ed9e8bd9202be.zip |
Remove EXMODE_NORMAL
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 538ebf7978..b0d06b7a30 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -2230,20 +2230,22 @@ 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. - * 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 & INSERT)) + // 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 & INSERT)) { c = Ctrl_L; - else if ((State & CMDLINE) - || (cmdwin_type > 0 && tc == ESC) - ) + } else if (exmode_active) { + c = '\n'; + } else if ((State & CMDLINE) || (cmdwin_type > 0 && tc == ESC)) { c = Ctrl_C; - else + } else { c = ESC; + } tc = c; break; } |