diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-12 06:50:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-12 06:50:52 +0800 |
commit | 72cf94fc0e69b7a049ae2990572876d641cf5cb9 (patch) | |
tree | 8db245af9fb892df25fd175f19c6ab03006ee3fe /test | |
parent | 8c5d81997e56a72fbb1392846a146cab2eb74b7f (diff) | |
download | rneovim-72cf94fc0e69b7a049ae2990572876d641cf5cb9.tar.gz rneovim-72cf94fc0e69b7a049ae2990572876d641cf5cb9.tar.bz2 rneovim-72cf94fc0e69b7a049ae2990572876d641cf5cb9.zip |
vim-patch:9.0.1694: wrong mapping applied when replaying a char search (#24670)
Problem: wrong mapping applied when replaying a char search
Solution: Store a NOP after the ESC
closes: vim/vim#12708
closes: vim/vim#6350
https://github.com/vim/vim/commit/bacc83009bc38c9ba0247aaa22b76d1993d57993
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_registers.vim | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/old/testdir/test_registers.vim b/test/old/testdir/test_registers.vim index 70dac535b4..01f9507916 100644 --- a/test/old/testdir/test_registers.vim +++ b/test/old/testdir/test_registers.vim @@ -758,8 +758,9 @@ func Test_record_in_select_mode() bwipe! endfunc -" mapping that ends macro recording should be removed from recorded macro +" A mapping that ends recording should be removed from the recorded register. func Test_end_record_using_mapping() + new call setline(1, 'aaa') nnoremap s q call feedkeys('safas', 'tx') @@ -779,7 +780,10 @@ func Test_end_record_using_mapping() bwipe! endfunc +" Starting a new recording should work immediately after replaying a recording +" that ends with a <Nop> mapping or a character search. func Test_end_reg_executing() + new nnoremap s <Nop> let @a = 's' call feedkeys("@aqaq\<Esc>", 'tx') @@ -797,5 +801,25 @@ func Test_end_reg_executing() bwipe! endfunc +" An operator-pending mode mapping shouldn't be applied to keys typed in +" Insert mode immediately after a character search when replaying. +func Test_replay_charsearch_omap() + CheckFeature timers + + new + call setline(1, 'foo[blah]') + onoremap , k + call timer_start(10, {-> feedkeys(",bar\<Esc>q", 't')}) + call feedkeys('qrct[', 'xt!') + call assert_equal(',bar[blah]', getline(1)) + undo + call assert_equal('foo[blah]', getline(1)) + call feedkeys('@r', 'xt!') + call assert_equal(',bar[blah]', getline(1)) + + ounmap , + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |