From: zeertzjq Date: Thu, 9 Apr 2026 18:55:02 +0000 (+0000) Subject: patch 9.2.0324: 0x9b byte not unescaped in mapping X-Git-Tag: v9.2.0324^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e2012914e0905eebfcf5de27a977ab166f93494;p=thirdparty%2Fvim.git patch 9.2.0324: 0x9b byte not unescaped in mapping Problem: 0x9b byte not unescaped in mapping (BenYip). Solution: Translate K_CSI to CSI like what is done in vgetc(). (zeertzjq). fixes: #19936 closes: #19937 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- diff --git a/src/getchar.c b/src/getchar.c index b4ef9ce82e..57e407b899 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -4283,6 +4283,13 @@ getcmdkeycmd( // to a single Esc here. if (c1 == K_ESC) c1 = ESC; + +#ifdef FEAT_GUI + // Translate K_CSI to CSI. The special key is only used to + // avoid it being recognized as the start of a special key. + if (c1 == K_CSI) + c1 = CSI; +#endif } if (got_int) diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index 01f2d1f944..29f42848d4 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -1124,7 +1124,11 @@ func Test_map_cmdkey() call setline(1, ['some short lines', 'of test text']) call feedkeys(":bar\x\\"\r", 'xt') call assert_equal('"barx', @:) - unmap! + + " test for chars with 0x80 or 0x9b bytes + map let x = '洛固四最倒倀' + call feedkeys("\", 'xt') + call assert_equal('洛固四最倒倀', x) " test for calling a function let lines =<< trim END @@ -1137,7 +1141,10 @@ func Test_map_cmdkey() source Xscript call feedkeys("\", 'xt') call assert_equal(32, g:x) + unlet g:x + unmap + unmap! unmap unmap! %bw! diff --git a/src/version.c b/src/version.c index fbe3e48eba..99a25eb7c1 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 324, /**/ 323, /**/