Skip to content

Commit 7ee6a67

Browse files
glepnirtechntools
authored andcommitted
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: vim#15978 Signed-off-by: glepnir <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent c68c9f9 commit 7ee6a67

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

src/popupmenu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,11 +839,11 @@ pum_redraw(void)
839839
#ifdef FEAT_RIGHTLEFT
840840
if (pum_rl)
841841
screen_fill(row, row + 1, pum_col - pum_width + 1, col + 1, ' ',
842-
' ', attr);
842+
' ', orig_attr);
843843
else
844844
#endif
845845
screen_fill(row, row + 1, col, pum_col + pum_width, ' ', ' ',
846-
attr);
846+
orig_attr);
847847
if (pum_scrollbar > 0)
848848
{
849849
#ifdef FEAT_RIGHTLEFT
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
|a+0&#ffffff0|w|o|r|d|1> @68
2+
|a+0#ff404010#e0e0e08|w|o|r|d|1| +0#0000001&@8| +0#4040ff13#ffffff0@59
3+
|你*0#ff404010#ffd7ff255|好| +0#0000001&@10| +0#4040ff13#ffffff0@59
4+
|~| @73
5+
|~| @73
6+
|~| @73
7+
|~| @73
8+
|~| @73
9+
|~| @73
10+
|~| @73
11+
|~| @73
12+
|~| @73
13+
|~| @73
14+
|~| @73
15+
|~| @73
16+
|~| @73
17+
|~| @73
18+
|~| @73
19+
|~| @73
20+
|-+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

src/testdir/test_popup.vim

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,17 +1507,28 @@ endfunc
15071507
func Test_pum_user_abbr_hlgroup()
15081508
CheckScreendump
15091509
let lines =<< trim END
1510-
func CompleteFunc( findstart, base )
1510+
let s:var = 0
1511+
func CompleteFunc(findstart, base)
15111512
if a:findstart
15121513
return 0
15131514
endif
1515+
if s:var == 1
1516+
return {
1517+
\ 'words': [
1518+
\ { 'word': 'aword1', 'abbr_hlgroup': 'StrikeFake' },
1519+
\ { 'word': '你好', 'abbr_hlgroup': 'StrikeFake' },
1520+
\]}
1521+
endif
15141522
return {
15151523
\ 'words': [
15161524
\ { 'word': 'aword1', 'menu': 'extra text 1', 'kind': 'W', 'abbr_hlgroup': 'StrikeFake' },
15171525
\ { 'word': 'aword2', 'menu': 'extra text 2', 'kind': 'W', },
15181526
\ { 'word': '你好', 'menu': 'extra text 3', 'kind': 'W', 'abbr_hlgroup': 'StrikeFake' },
15191527
\]}
15201528
endfunc
1529+
func ChangeVar()
1530+
let s:var = 1
1531+
endfunc
15211532
set completeopt=menu
15221533
set completefunc=CompleteFunc
15231534

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

1559+
call TermWait(buf)
1560+
call term_sendkeys(buf, ":call ChangeVar()\<CR>")
1561+
call TermWait(buf)
1562+
call term_sendkeys(buf, "S\<C-X>\<C-U>")
1563+
call VerifyScreenDump(buf, 'Test_pum_highlights_17', {})
1564+
call term_sendkeys(buf, "\<C-E>\<Esc>")
1565+
15481566
call StopVimInTerminal(buf)
15491567
endfunc
15501568

15511569
func Test_pum_user_kind_hlgroup()
15521570
CheckScreendump
15531571
let lines =<< trim END
1554-
func CompleteFunc( findstart, base )
1572+
func CompleteFunc(findstart, base)
15551573
if a:findstart
15561574
return 0
15571575
endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
830,
707709
/**/
708710
829,
709711
/**/

0 commit comments

Comments
 (0)