patch 9.1.0629: Rename of pum hl_group is incomplete
Problem: Rename of pum hl_group is incomplete in source.
Solution: Also rename the test function. Rename to user_hlattr in code
to avoid confusion with pum_extra. Add test with matched text
highlighting (zeertzjq).
closes: #15348
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 67e600c..4c2fb45 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1499,10 +1499,9 @@
call StopVimInTerminal(buf)
endfunc
-func Test_pum_extrahl()
+func Test_pum_user_hl_group()
CheckScreendump
let lines =<< trim END
- hi StrikeFake ctermfg=9
func CompleteFunc( findstart, base )
if a:findstart
return 0
@@ -1516,15 +1515,31 @@
endfunc
set completeopt=menu
set completefunc=CompleteFunc
+
+ hi StrikeFake ctermfg=9
+ func HlMatch()
+ hi PmenuMatchSel ctermfg=6 ctermbg=7 cterm=underline
+ hi PmenuMatch ctermfg=4 ctermbg=225 cterm=underline
+ endfunc
END
call writefile(lines, 'Xscript', 'D')
let buf = RunVimInTerminal('-S Xscript', {})
+
call TermWait(buf)
- call term_sendkeys(buf, "iaw\<C-X>\<C-u>")
- call TermWait(buf, 50)
+ call term_sendkeys(buf, "Saw\<C-X>\<C-U>")
call VerifyScreenDump(buf, 'Test_pum_highlights_12', {})
- call term_sendkeys(buf, "\<C-E>\<Esc>u")
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
+
call TermWait(buf)
+ call term_sendkeys(buf, ":call HlMatch()\<CR>")
+
+ call TermWait(buf)
+ call term_sendkeys(buf, "Saw\<C-X>\<C-U>")
+ call VerifyScreenDump(buf, 'Test_pum_highlights_13', {})
+ call term_sendkeys(buf, "\<C-N>")
+ call VerifyScreenDump(buf, 'Test_pum_highlights_14', {})
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
+
call StopVimInTerminal(buf)
endfunc