diff src/testdir/test_cmdline.vim @ 11026:fa69f6272692 v8.0.0402

patch 8.0.0402: :map completion does not have <special> commit https://github.com/vim/vim/commit/cf5fdf7d1689ecb145b634dcb9c6e9fc60f63869 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 2 23:05:51 2017 +0100 patch 8.0.0402: :map completion does not have <special> Problem: :map completion does not have <special>. (Dominique Pelle) Solution: Recognize <special> in completion. Add a test.
author Christian Brabandt <cb@256bit.org>
date Thu, 02 Mar 2017 23:15:05 +0100
parents f8ebfa168818
children ae45d497868f
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -25,6 +25,26 @@ func Test_complete_wildmenu()
   set nowildmenu
 endfunc
 
+func Test_map_completion()
+  if !has('cmdline_compl')
+    return
+  endif
+  call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"map <unique> <silent>', getreg(':'))
+  call feedkeys(":map <script> <un\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"map <script> <unique>', getreg(':'))
+  call feedkeys(":map <expr> <sc\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"map <expr> <script>', getreg(':'))
+  call feedkeys(":map <buffer> <e\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"map <buffer> <expr>', getreg(':'))
+  call feedkeys(":map <nowait> <b\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"map <nowait> <buffer>', getreg(':'))
+  call feedkeys(":map <special> <no\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"map <special> <nowait>', getreg(':'))
+  call feedkeys(":map <silent> <sp\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal('"map <silent> <special>', getreg(':'))
+endfunc
+
 func Test_match_completion()
   if !has('cmdline_compl')
     return