From bf065d9bb654263e59949a68d0b90fd196ab1ab8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Apr 2022 20:28:58 +0800 Subject: vim-patch:8.2.4829: a key may be simplified to NUL Problem: A key may be simplified to NUL. Solution: Use K_ZERO instead. Use macros instead of hard coded values. (closes vim/vim#10290) https://github.com/vim/vim/commit/17c95d9608370559441bb73941ba6d9a4b6b26bd --- src/nvim/testdir/test_termcodes.vim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/nvim/testdir/test_termcodes.vim (limited to 'src/nvim/testdir/test_termcodes.vim') diff --git a/src/nvim/testdir/test_termcodes.vim b/src/nvim/testdir/test_termcodes.vim new file mode 100644 index 0000000000..ecd408264d --- /dev/null +++ b/src/nvim/testdir/test_termcodes.vim @@ -0,0 +1,9 @@ + +func Test_simplify_ctrl_at() + " feeding unsimplified CTRL-@ should still trigger i_CTRL-@ + call feedkeys("ifoo\A\<*C-@>", 'xt') + call assert_equal('foofoo', getline(1)) +endfunc + + +" vim: shiftwidth=2 sts=2 expandtab -- cgit From 1d97781dc53416072387b1d71aeaf11caecd8cf0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Apr 2022 20:30:52 +0800 Subject: vim-patch:8.2.4833: failure of mapping not checked for Problem: Failure of mapping not checked for. Solution: Check return value of ins_typebuf(). (closes vim/vim#10299) https://github.com/vim/vim/commit/12e21e387b5bbc928097abf1c189b7dc665838fc --- src/nvim/testdir/test_termcodes.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir/test_termcodes.vim') diff --git a/src/nvim/testdir/test_termcodes.vim b/src/nvim/testdir/test_termcodes.vim index ecd408264d..987889f33c 100644 --- a/src/nvim/testdir/test_termcodes.vim +++ b/src/nvim/testdir/test_termcodes.vim @@ -1,8 +1,9 @@ func Test_simplify_ctrl_at() " feeding unsimplified CTRL-@ should still trigger i_CTRL-@ - call feedkeys("ifoo\A\<*C-@>", 'xt') - call assert_equal('foofoo', getline(1)) + call feedkeys("ifoo\A\<*C-@>x", 'xt') + call assert_equal('foofo', getline(1)) + bw! endfunc -- cgit From 4adf2123dd94a3d5303fe200c7e909067e1cda34 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 28 Apr 2022 21:18:58 +0800 Subject: vim-patch:8.2.4837: modifiers not simplified when timed out Problem: Modifiers not simplified when timed out or using feedkeys() with 'n" flag. Solution: Adjust how mapped flag and timeout are used. (closes vim/vim#10305) https://github.com/vim/vim/commit/68a573ce2b996602a86b14d9b258ebb8c657604f --- src/nvim/testdir/test_termcodes.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/testdir/test_termcodes.vim') diff --git a/src/nvim/testdir/test_termcodes.vim b/src/nvim/testdir/test_termcodes.vim index 987889f33c..f3b10a922e 100644 --- a/src/nvim/testdir/test_termcodes.vim +++ b/src/nvim/testdir/test_termcodes.vim @@ -6,5 +6,21 @@ func Test_simplify_ctrl_at() bw! endfunc +func Test_simplify_noremap() + call feedkeys("i\<*C-M>", 'nx') + call assert_equal('', getline(1)) + call assert_equal([0, 2, 1, 0, 1], getcurpos()) + bw! +endfunc + +func Test_simplify_timedout() + inoremap a b + call feedkeys("i\<*C-M>", 'xt') + call assert_equal('', getline(1)) + call assert_equal([0, 2, 1, 0, 1], getcurpos()) + iunmap a + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit