diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-01-30 07:56:54 +0800 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-03-24 11:02:39 +0100 |
commit | d7488bf38677b5d6b1df3a88e45b3d2f21527eb4 (patch) | |
tree | 5b436b807d7aaa6f9e2eb4ab5d5c9cde58e908a5 /src/nvim/getchar.c | |
parent | a72f338d76c871869712518df862c85d1df25f54 (diff) | |
download | rneovim-d7488bf38677b5d6b1df3a88e45b3d2f21527eb4.tar.gz rneovim-d7488bf38677b5d6b1df3a88e45b3d2f21527eb4.tar.bz2 rneovim-d7488bf38677b5d6b1df3a88e45b3d2f21527eb4.zip |
feat(input)!: delay some conversions to vgetc()
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 |