From 147917369ed8d372feaa9181acd249277636da26 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 18 Nov 2020 14:49:25 +0100 Subject: vim-patch:8.2.2005: redoing a mapping with doesn't work properly Problem: Redoing a mapping with doesn't work properly. Solution: Fill the redo buffer. Use "" instead of a key code. (closes vim/vim#7282) https://github.com/vim/vim/commit/c77534c303721df4024fd6cfd51098d593b7d4da --- src/nvim/testdir/test_mapping.vim | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 152afb4b9d..c4807797ff 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -499,4 +499,40 @@ func Test_mapcomplete() call assert_match("abbr! \x01", @:) endfunc +func Test_map_cmdkey_redo() + func SelectDash() + call search('^---\n\zs', 'bcW') + norm! V + call search('\n\ze---$', 'W') + endfunc + + let text =<< trim END + --- + aaa + --- + bbb + bbb + --- + ccc + ccc + ccc + --- + END + new Xcmdtext + call setline(1, text) + + onoremap i- call SelectDash() + call feedkeys('2Gdi-', 'xt') + call assert_equal(['---', '---'], getline(1, 2)) + call feedkeys('j.', 'xt') + call assert_equal(['---', '---', '---'], getline(1, 3)) + call feedkeys('j.', 'xt') + call assert_equal(['---', '---', '---', '---'], getline(1, 4)) + + bwipe! + call delete('Xcmdtext') + delfunc SelectDash + ounmap i- +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit