vim-patch:8.0.0513: fix getting name of cleared highlight group (#8103)

Problem:    Getting name of cleared highlight group is wrong. (Matt Wozniski)
Solution:   Only skip over cleared names for completion. (closes vim/vim#1592)
            Also fix that a cleared group causes duplicate completions.
c96272e30e
This commit is contained in:
KunMing Xie
2018-03-09 02:49:21 +08:00
committed by Justin M. Keyes
parent 1d5eec2c62
commit 5ec0a6d13f
5 changed files with 28 additions and 9 deletions

View File

@@ -322,13 +322,16 @@ func Test_syn_clear()
syntax keyword Bar tar
call assert_match('Foo', execute('syntax'))
call assert_match('Bar', execute('syntax'))
call assert_equal('Foo', synIDattr(hlID("Foo"), "name"))
syn clear Foo
call assert_notmatch('Foo', execute('syntax'))
call assert_match('Bar', execute('syntax'))
call assert_equal('Foo', synIDattr(hlID("Foo"), "name"))
syn clear Foo Bar
call assert_notmatch('Foo', execute('syntax'))
call assert_notmatch('Bar', execute('syntax'))
hi clear Foo
call assert_equal('Foo', synIDattr(hlID("Foo"), "name"))
hi clear Bar
endfunc