aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2018-02-15 22:50:41 +0800
committerJustin M. Keyes <justinkz@gmail.com>2018-03-04 16:34:59 +0100
commitb615192a37eb025b71276635845b57831b9f2c6b (patch)
tree3372713365ac35cb9066b04efa1fb12264f420c6 /src/nvim/testdir
parent544cef0155ecb006c34e8471733cac6bdfd61989 (diff)
downloadrneovim-b615192a37eb025b71276635845b57831b9f2c6b.tar.gz
rneovim-b615192a37eb025b71276635845b57831b9f2c6b.tar.bz2
rneovim-b615192a37eb025b71276635845b57831b9f2c6b.zip
vim-patch:8.0.0220: highlight completion misses some values #8013
Problem: Completion for :match does not show "none" and other missing highlight names. Solution: Skip over cleared entries before checking the index to be at the end. https://github.com/vim/vim/commit/15eedf1d621d980cb40f50cc6a78a09ab94388c7
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cmdline.vim44
1 files changed, 35 insertions, 9 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 1bf5930eb9..94330fe67b 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -46,8 +46,34 @@ func Test_map_completion()
call assert_equal('"map <silent> <special>', getreg(':'))
endfunc
+func Test_match_completion()
+ if !has('cmdline_compl')
+ return
+ endif
+ hi Aardig ctermfg=green
+ call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt')
+ call assert_equal('"match Aardig', getreg(':'))
+ call feedkeys(":match \<S-Tab>\<Home>\"\<CR>", 'xt')
+ call assert_equal('"match none', getreg(':'))
+endfunc
+
+func Test_highlight_completion()
+ if !has('cmdline_compl')
+ return
+ endif
+ hi Aardig ctermfg=green
+ call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
+ call assert_equal('"hi Aardig', getreg(':'))
+ call feedkeys(":hi li\<S-Tab>\<Home>\"\<CR>", 'xt')
+ call assert_equal('"hi link', getreg(':'))
+ call feedkeys(":hi d\<S-Tab>\<Home>\"\<CR>", 'xt')
+ call assert_equal('"hi default', getreg(':'))
+ call feedkeys(":hi c\<S-Tab>\<Home>\"\<CR>", 'xt')
+ call assert_equal('"hi clear', getreg(':'))
+endfunc
+
func Test_expr_completion()
- if !(has('cmdline_compl') && has('eval'))
+ if !has('cmdline_compl')
return
endif
for cmd in [
@@ -286,17 +312,17 @@ func Test_paste_in_cmdline()
endfunc
func Test_remove_char_in_cmdline()
- call feedkeys(":abc def\<S-Left>\<Del>\<C-B>\"\<CR>", 'tx')
- call assert_equal('"abc ef', @:)
+ call feedkeys(":abc def\<S-Left>\<Del>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"abc ef', @:)
- call feedkeys(":abc def\<S-Left>\<BS>\<C-B>\"\<CR>", 'tx')
- call assert_equal('"abcdef', @:)
+ call feedkeys(":abc def\<S-Left>\<BS>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"abcdef', @:)
- call feedkeys(":abc def ghi\<S-Left>\<C-W>\<C-B>\"\<CR>", 'tx')
- call assert_equal('"abc ghi', @:)
+ call feedkeys(":abc def ghi\<S-Left>\<C-W>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"abc ghi', @:)
- call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
- call assert_equal('"def', @:)
+ call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"def', @:)
endfunc
func Test_illegal_address1()