From cfbbec6fdaf37ef40dcd7829c2d5b3cd7cf33065 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 10 Apr 2026 07:03:56 +0800 Subject: [PATCH] vim-patch:9.2.0324: 0x9b byte not unescaped in mapping (#38919) Problem: 0x9b byte not unescaped in mapping (BenYip). Solution: Translate K_CSI to CSI like what is done in vgetc(). (zeertzjq). fixes: vim/vim#19936 closes: vim/vim#19937 https://github.com/vim/vim/commit/3e2012914e0905eebfcf5de27a977ab166f93494 --- test/old/testdir/test_mapping.vim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/old/testdir/test_mapping.vim b/test/old/testdir/test_mapping.vim index 96fa0304dc..2c6730bfed 100644 --- a/test/old/testdir/test_mapping.vim +++ b/test/old/testdir/test_mapping.vim @@ -1118,7 +1118,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 @@ -1127,12 +1131,14 @@ func Test_map_cmdkey() let g:x = 32 endfunc END - call writefile(lines, 'Xscript') + call writefile(lines, 'Xscript', 'D') source Xscript call feedkeys("\", 'xt') call assert_equal(32, g:x) - call delete('Xscript') + unlet g:x + unmap + unmap! unmap unmap! %bw!