Commit: patch 9.1.0830: using wrong highlight group for spaces for popupmenu

2 views
Skip to first unread message

Christian Brabandt

unread,
Nov 2, 2024, 12:00:10 PM11/2/24
to vim...@googlegroups.com
patch 9.1.0830: using wrong highlight group for spaces for popupmenu

Commit: https://github.com/vim/vim/commit/bc10be7a4060748ed1876ab91cf53a2a8701ac13
Author: glepnir <gleph...@gmail.com>
Date: Sat Nov 2 16:45:01 2024 +0100

patch 9.1.0830: using wrong highlight group for spaces for popupmenu

Problem: using wrong highlight group for spaces for popupmenu
Solution: use original attribute instead of combined attributed
(glepnir)

closes: #15978

Signed-off-by: glepnir <gleph...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/popupmenu.c b/src/popupmenu.c
index 4d77c666a..be8016f62 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -839,11 +839,11 @@ pum_redraw(void)
#ifdef FEAT_RIGHTLEFT
if (pum_rl)
screen_fill(row, row + 1, pum_col - pum_width + 1, col + 1, ' ',
- ' ', attr);
+ ' ', orig_attr);
else
#endif
screen_fill(row, row + 1, col, pum_col + pum_width, ' ', ' ',
- attr);
+ orig_attr);
if (pum_scrollbar > 0)
{
#ifdef FEAT_RIGHTLEFT
diff --git a/src/testdir/dumps/Test_pum_highlights_17.dump b/src/testdir/dumps/Test_pum_highlights_17.dump
new file mode 100644
index 000000000..2439c4c10
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_highlights_17.dump
@@ -0,0 +1,20 @@
+|a+0&#ffffff0|w|o|r|d|1> @68
+|a+0#ff404010#e0e0e08|w|o|r|d|1| +0#0000001&@8| +0#4040ff13#ffffff0@59
+|你*0#ff404010#ffd7ff255|好| +0#0000001&@10| +0#4040ff13#ffffff0@59
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@26
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 3c748a4a5..6b807c8c3 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1507,10 +1507,18 @@ endfunc
func Test_pum_user_abbr_hlgroup()
CheckScreendump
let lines =<< trim END
- func CompleteFunc( findstart, base )
+ let s:var = 0
+ func CompleteFunc(findstart, base)
if a:findstart
return 0
endif
+ if s:var == 1
+ return {
+ \ 'words': [
+ \ { 'word': 'aword1', 'abbr_hlgroup': 'StrikeFake' },
+ \ { 'word': '你好', 'abbr_hlgroup': 'StrikeFake' },
+ \]}
+ endif
return {
\ 'words': [
\ { 'word': 'aword1', 'menu': 'extra text 1', 'kind': 'W', 'abbr_hlgroup': 'StrikeFake' },
@@ -1518,6 +1526,9 @@ func Test_pum_user_abbr_hlgroup()
\ { 'word': '你好', 'menu': 'extra text 3', 'kind': 'W', 'abbr_hlgroup': 'StrikeFake' },
\]}
endfunc
+ func ChangeVar()
+ let s:var = 1
+ endfunc
set completeopt=menu
set completefunc=CompleteFunc

@@ -1545,13 +1556,20 @@ func Test_pum_user_abbr_hlgroup()
call VerifyScreenDump(buf, 'Test_pum_highlights_14', {})
call term_sendkeys(buf, "\<C-E>\<Esc>")

+ call TermWait(buf)
+ call term_sendkeys(buf, ":call ChangeVar()\<CR>")
+ call TermWait(buf)
+ call term_sendkeys(buf, "S\<C-X>\<C-U>")
+ call VerifyScreenDump(buf, 'Test_pum_highlights_17', {})
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
+
call StopVimInTerminal(buf)
endfunc

func Test_pum_user_kind_hlgroup()
CheckScreendump
let lines =<< trim END
- func CompleteFunc( findstart, base )
+ func CompleteFunc(findstart, base)
if a:findstart
return 0
endif
diff --git a/src/version.c b/src/version.c
index 27d5bc6dd..74660c687 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 830,
/**/
829,
/**/
Reply all
Reply to author
Forward
0 new messages