From 4a44120e3dc1d40dd7109658afd5e078360b1d8f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Nov 2020 14:43:26 +0100 Subject: [PATCH] patch 8.2.2062: does not handle CTRL-V Problem: does not handle CTRL-V. Solution: Call get_literal() after encountering CTRL-V. (closes #7387) --- src/getchar.c | 8 ++++++++ src/testdir/test_mapping.vim | 5 +++++ src/version.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/src/getchar.c b/src/getchar.c index ad21cba7f2..42eed4a9e7 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -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; diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index 66edaa80a6..1750f39d53 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -972,6 +972,11 @@ func Test_map_cmdkey() unmap unmap! %bw! + + " command line ending in "0" is handled without errors + onoremap ix eval 0 + call feedkeys('dix.', 'xt') + ounmap ix endfunc " text object enters visual mode diff --git a/src/version.c b/src/version.c index 395aee1a2b..ef1c5db310 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2062, /**/ 2061, /**/ -- 2.47.2