aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/popupmenu_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-27 21:44:05 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-07-27 21:56:44 +0800
commitb8b0e9db3f91fbaa8835b90c683c33310064c8c8 (patch)
tree350d237bd0f5f74fe146b8b73f83243ec4d3d56a /test/functional/ui/popupmenu_spec.lua
parent985c636aa6dfcec2a1b788549c3f3ac058c8d141 (diff)
downloadrneovim-b8b0e9db3f91fbaa8835b90c683c33310064c8c8.tar.gz
rneovim-b8b0e9db3f91fbaa8835b90c683c33310064c8c8.tar.bz2
rneovim-b8b0e9db3f91fbaa8835b90c683c33310064c8c8.zip
vim-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: vim/vim#15348 https://github.com/vim/vim/commit/4100852e099133a0c9603e1087e5dc6d82001ce7
Diffstat (limited to 'test/functional/ui/popupmenu_spec.lua')
-rw-r--r--test/functional/ui/popupmenu_spec.lua55
1 files changed, 52 insertions, 3 deletions
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index 26110b559d..c73d5bf97a 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -1181,6 +1181,26 @@ describe('builtin popupmenu', function()
mn = { foreground = Screen.colors.Blue, background = Screen.colors.Plum1 },
ds = { foreground = Screen.colors.DarkRed, background = Screen.colors.Grey },
dn = { foreground = Screen.colors.DarkRed, background = Screen.colors.Plum1 },
+ ums = {
+ foreground = Screen.colors.Blue,
+ background = Screen.colors.Grey,
+ underline = true,
+ },
+ umn = {
+ foreground = Screen.colors.Blue,
+ background = Screen.colors.Plum1,
+ underline = true,
+ },
+ uds = {
+ foreground = Screen.colors.DarkRed,
+ background = Screen.colors.Grey,
+ underline = true,
+ },
+ udn = {
+ foreground = Screen.colors.DarkRed,
+ background = Screen.colors.Plum1,
+ underline = true,
+ },
})
screen:attach({ ext_multigrid = multigrid })
end)
@@ -4934,10 +4954,9 @@ describe('builtin popupmenu', function()
feed('<C-E><Esc>')
end)
- -- oldtest: Test_pum_extrahl()
+ -- oldtest: Test_pum_user_hl_group()
it('custom hl_group override', function()
exec([[
- hi StrikeFake guifg=DarkRed
func CompleteFunc( findstart, base )
if a:findstart
return 0
@@ -4951,8 +4970,15 @@ describe('builtin popupmenu', function()
endfunc
set completeopt=menu
set completefunc=CompleteFunc
+
+ hi StrikeFake guifg=DarkRed
+ func HlMatch()
+ hi PmenuMatchSel guifg=Blue guibg=Grey gui=underline
+ hi PmenuMatch guifg=Blue guibg=Plum1 gui=underline
+ endfunc
]])
- feed('<ESC>iaw<C-X><C-U>')
+
+ feed('Saw<C-X><C-U>')
screen:expect([[
aword1^ |
{ds:aword1 W extra text 1 }{1: }|
@@ -4961,6 +4987,29 @@ describe('builtin popupmenu', function()
{1:~ }|*15
{2:-- }{5:match 1 of 3} |
]])
+ feed('<C-E><Esc>')
+
+ command('call HlMatch()')
+
+ feed('Saw<C-X><C-U>')
+ screen:expect([[
+ aword1^ |
+ {uds:aw}{ds:ord1 W extra text 1 }{1: }|
+ {umn:aw}{n:ord2 W extra text 2 }{1: }|
+ {dn:你好 W extra text 3 }{1: }|
+ {1:~ }|*15
+ {2:-- }{5:match 1 of 3} |
+ ]])
+ feed('<C-N>')
+ screen:expect([[
+ aword2^ |
+ {udn:aw}{dn:ord1 W extra text 1 }{1: }|
+ {ums:aw}{s:ord2 W extra text 2 }{1: }|
+ {dn:你好 W extra text 3 }{1: }|
+ {1:~ }|*15
+ {2:-- }{5:match 2 of 3} |
+ ]])
+ feed('<C-E><Esc>')
end)
end
end