From a724209b5a34e40fe2fff338ff7c5db2bc395bbc Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 4 Aug 2019 19:12:35 -0400 Subject: vim-patch:8.1.1251: test completion of mapping keys #10691 Problem: No test for completion of mapping keys. Solution: Add a test. Also clean up the code. https://github.com/vim/vim/commit/2cb9f0253228478ec27265ff40f59c629874d695 --- src/nvim/testdir/test_cmdline.vim | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/nvim/testdir/test_cmdline.vim') diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index eb18284b4a..4b333e444a 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -44,6 +44,42 @@ func Test_map_completion() call assert_equal('"map ', getreg(':')) call feedkeys(":map \\"\", 'xt') call assert_equal('"map ', getreg(':')) + + map ,f commaf + map ,g commaf + call feedkeys(":map ,\\\"\", 'xt') + call assert_equal('"map ,f', getreg(':')) + call feedkeys(":map ,\\\\"\", 'xt') + call assert_equal('"map ,g', getreg(':')) + unmap ,f + unmap ,g + + set cpo-=< cpo-=B cpo-=k + map left + call feedkeys(":map \\"\", 'xt') + call assert_equal('"map ', getreg(':')) + unmap + + " set cpo+=< + map left + call feedkeys(":map \\"\", 'xt') + call assert_equal('"map ', getreg(':')) + unmap + set cpo-=< + + set cpo+=B + map left + call feedkeys(":map \\"\", 'xt') + call assert_equal('"map ', getreg(':')) + unmap + set cpo-=B + + " set cpo+=k + map left + call feedkeys(":map \\"\", 'xt') + call assert_equal('"map ', getreg(':')) + unmap + " set cpo-=k endfunc func Test_match_completion() -- cgit