]> granicus.if.org Git - vim/commitdiff
patch 8.2.2062: <Cmd> does not handle CTRL-V v8.2.2062
authorBram Moolenaar <Bram@vim.org>
Sat, 28 Nov 2020 13:43:26 +0000 (14:43 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 28 Nov 2020 13:43:26 +0000 (14:43 +0100)
Problem:    <Cmd> does not handle CTRL-V.
Solution:   Call get_literal() after encountering CTRL-V. (closes #7387)

src/getchar.c
src/testdir/test_mapping.vim
src/version.c

index ad21cba7f26e1ab535daaa7f9a77b4d0471e10df..42eed4a9e72e990f94fc83e4c3fe32a1f82dbec8 100644 (file)
@@ -3675,6 +3675,14 @@ getcmdkeycmd(
            }
            c1 = TO_SPECIAL(c1, c2);
        }
+       if (c1 == Ctrl_V)
+       {
+           // CTRL-V is followed by octal, hex or other characters, reverses
+           // what AppendToRedobuffLit() does.
+           no_reduce_keys = TRUE;  //  don't merge modifyOtherKeys
+           c1 = get_literal();
+           no_reduce_keys = FALSE;
+       }
 
        if (got_int)
            aborted = TRUE;
index 66edaa80a68edb7cf5b1af97759b41165fdc396c..1750f39d5342c2bf6f0da9fcad2185b841bd44dd 100644 (file)
@@ -972,6 +972,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
index 395aee1a2bfb20282b1a461be17335a1f1251eaa..ef1c5db310c7e424ad4aa92d618b29f6137b35f0 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2062,
 /**/
     2061,
 /**/