Skip to content

Commit 4a44120

Browse files
committed
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 #7387)
1 parent 4d05af0 commit 4a44120

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/getchar.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3675,6 +3675,14 @@ getcmdkeycmd(
36753675
}
36763676
c1 = TO_SPECIAL(c1, c2);
36773677
}
3678+
if (c1 == Ctrl_V)
3679+
{
3680+
// CTRL-V is followed by octal, hex or other characters, reverses
3681+
// what AppendToRedobuffLit() does.
3682+
no_reduce_keys = TRUE; // don't merge modifyOtherKeys
3683+
c1 = get_literal();
3684+
no_reduce_keys = FALSE;
3685+
}
36783686

36793687
if (got_int)
36803688
aborted = TRUE;

src/testdir/test_mapping.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,11 @@ func Test_map_cmdkey()
972972
unmap <F3>
973973
unmap! <F3>
974974
%bw!
975+
976+
" command line ending in "0" is handled without errors
977+
onoremap ix <cmd>eval 0<cr>
978+
call feedkeys('dix.', 'xt')
979+
ounmap ix
975980
endfunc
976981

977982
" text object enters visual mode

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2062,
753755
/**/
754756
2061,
755757
/**/

0 commit comments

Comments
 (0)