diff options
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 3ec5d24753..c10172cc52 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1583,6 +1583,14 @@ int vgetc(void) c = utf_ptr2char(buf); } + if ((mod_mask & MOD_MASK_CTRL) && (c >= '?' && c <= '_')) { + c = Ctrl_chr(c); + mod_mask &= ~MOD_MASK_CTRL; + if (c == 0) { // <C-@> is <Nul> + c = K_ZERO; + } + } + // If mappings are enabled (i.e., not Ctrl-v) and the user directly typed // something with a meta- or alt- modifier that was not mapped, interpret // <M-x> as <Esc>x rather than as an unbound meta keypress. #8213 |