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)

4a44120e3d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq 2023-05-07 08:31:06 +08:00
parent a2b9117ca8
commit f7c1e460f8
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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