diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_map_functions.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/old/testdir/test_map_functions.vim b/test/old/testdir/test_map_functions.vim index 8f7c8bae76..5118063b36 100644 --- a/test/old/testdir/test_map_functions.vim +++ b/test/old/testdir/test_map_functions.vim @@ -527,6 +527,25 @@ func Test_map_restore_negative_sid() call delete('Xresult') endfunc +" Check that restoring a mapping doesn't remove a mapping whose {rhs} matches +" the restored mapping's {lhs}. +func Test_map_restore_with_rhs_match_lhs() + nnoremap <F2> <F3> + nnoremap <F3> <F4> + call assert_equal('<F3>', maparg('<F2>', 'n')) + call assert_equal('<F4>', maparg('<F3>', 'n')) + let d = maparg('<F3>', 'n', v:false, v:true) + nunmap <F3> + call assert_equal('<F3>', maparg('<F2>', 'n')) + call assert_equal('', maparg('<F3>', 'n')) + call mapset(d) + call assert_equal('<F3>', maparg('<F2>', 'n')) + call assert_equal('<F4>', maparg('<F3>', 'n')) + + nunmap <F2> + nunmap <F3> +endfunc + func Test_maplist() new func s:ClearMappingsAbbreviations() |