diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-07 08:31:06 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-05-08 01:12:09 +0800 |
commit | f7c1e460f8ae9e316a679a29945ce6a585336322 (patch) | |
tree | 2270e38c35b6445d1c1cc37b0423d7c28bc9552d | |
parent | a2b9117ca8f8abe8d4c9e2d1bacb73b1902a4e1f (diff) | |
download | rneovim-f7c1e460f8ae9e316a679a29945ce6a585336322.tar.gz rneovim-f7c1e460f8ae9e316a679a29945ce6a585336322.tar.bz2 rneovim-f7c1e460f8ae9e316a679a29945ce6a585336322.zip |
vim-patch:8.2.2062: <Cmd> does not handle CTRL-V
Problem: <Cmd> does not handle CTRL-V.
Solution: Call get_literal() after encountering CTRL-V. (closes vim/vim#7387)
https://github.com/vim/vim/commit/4a44120e3dc1d40dd7109658afd5e078360b1d8f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | src/nvim/getchar.c | 5 | ||||
-rw-r--r-- | test/old/testdir/test_mapping.vim | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 31817676e1..32fa517324 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -2927,6 +2927,11 @@ char *getcmdkeycmd(int promptc, void *cookie, int indent, bool do_concat) } c1 = TO_SPECIAL(c1, c2); } + if (c1 == Ctrl_V) { + // CTRL-V is followed by octal, hex or other characters, reverses + // what AppendToRedobuffLit() does. + c1 = get_literal(true); + } if (got_int) { aborted = true; diff --git a/test/old/testdir/test_mapping.vim b/test/old/testdir/test_mapping.vim index b695c9e29b..ec57bea59e 100644 --- a/test/old/testdir/test_mapping.vim +++ b/test/old/testdir/test_mapping.vim @@ -1084,6 +1084,11 @@ func Test_map_cmdkey() unmap <F3> unmap! <F3> %bw! + + " command line ending in "0" is handled without errors + onoremap ix <cmd>eval 0<cr> + call feedkeys('dix.', 'xt') + ounmap ix endfunc " text object enters visual mode |