patch 9.1.0618: cannot mark deprecated attributes in completion menu
Problem: cannot mark deprecated attributes in completion menu
Solution: add hl_group to the Dictionary of supported completion fields
(glepnir)
closes: #15314
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/popupmenu.c b/src/popupmenu.c
index c116b10..0f19c9e 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -510,7 +510,8 @@
int cells UNUSED,
char_u *text,
int textlen,
- int *attrs)
+ int *attrs,
+ int extra_attr)
{
int col_start = col;
char_u *ptr = text;
@@ -527,6 +528,8 @@
else
#endif
attr = attrs[col - col_start];
+ if (extra_attr > 0)
+ attr = hl_combine_attr(extra_attr, attr);
screen_puts_len(ptr, char_len, row, col, attr);
col += mb_ptr2cells(ptr);
ptr += char_len;
@@ -628,6 +631,8 @@
{
hlf = hlfs[round];
attr = highlight_attr[hlf];
+ if (pum_array[idx].pum_extrahlattr > 0)
+ attr = hl_combine_attr(attr, pum_array[idx].pum_extrahlattr);
width = 0;
s = NULL;
switch (round)
@@ -698,7 +703,8 @@
else
pum_screen_puts_with_attrs(row,
col - cells + 1, cells, rt,
- (int)STRLEN(rt), attrs);
+ (int)STRLEN(rt), attrs,
+ pum_array[idx].pum_extrahlattr);
vim_free(rt_start);
}
@@ -732,7 +738,8 @@
screen_puts_len(st, size, row, col, attr);
else
pum_screen_puts_with_attrs(row, col, cells,
- st, size, attrs);
+ st, size, attrs,
+ pum_array[idx].pum_extrahlattr);
vim_free(st);
}