aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/popupmenu.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-11-03 08:27:15 +0800
committerGitHub <noreply@github.com>2024-11-03 08:27:15 +0800
commited3fb1bb9ad97435c50655ee8de71b2d7d67d01c (patch)
tree1c9871360a3092decd8d442857ac3424168ea28b /src/nvim/popupmenu.c
parentf3606416f0eb36977e174c512d96542c54ff3162 (diff)
downloadrneovim-ed3fb1bb9ad97435c50655ee8de71b2d7d67d01c.tar.gz
rneovim-ed3fb1bb9ad97435c50655ee8de71b2d7d67d01c.tar.bz2
rneovim-ed3fb1bb9ad97435c50655ee8de71b2d7d67d01c.zip
vim-patch:9.1.0830: using wrong highlight group for spaces for popupmenu (#31054)
Problem: using wrong highlight group for spaces for popupmenu Solution: use original attribute instead of combined attributed (glepnir) closes: vim/vim#15978 https://github.com/vim/vim/commit/bc10be7a4060748ed1876ab91cf53a2a8701ac13 Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'src/nvim/popupmenu.c')
-rw-r--r--src/nvim/popupmenu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c
index 529d65c5dc..7df6a1a5d7 100644
--- a/src/nvim/popupmenu.c
+++ b/src/nvim/popupmenu.c
@@ -657,11 +657,14 @@ void pum_redraw(void)
pum_align_order(order);
int basic_width = items_width_array[order[0]]; // first item width
bool last_isabbr = order[2] == CPT_ABBR;
+ int orig_attr = -1;
+
for (int j = 0; j < 3; j++) {
int item_type = order[j];
hlf = hlfs[item_type];
attr = win_hl_attr(curwin, (int)hlf);
- int orig_attr = attr;
+ attr = hl_combine_attr(win_hl_attr(curwin, HLF_PNI), attr);
+ orig_attr = attr;
int user_abbr_hlattr = pum_array[idx].pum_user_abbr_hlattr;
int user_kind_hlattr = pum_array[idx].pum_user_kind_hlattr;
if (item_type == CPT_ABBR && user_abbr_hlattr > 0) {
@@ -670,7 +673,6 @@ void pum_redraw(void)
if (item_type == CPT_KIND && user_kind_hlattr > 0) {
attr = hl_combine_attr(attr, user_kind_hlattr);
}
- attr = hl_combine_attr(win_hl_attr(curwin, HLF_PNI), attr);
int width = 0;
char *s = NULL;
p = pum_get_item(idx, item_type);
@@ -796,9 +798,9 @@ void pum_redraw(void)
}
if (pum_rl) {
- grid_line_fill(col_off - pum_width + 1, grid_col + 1, schar_from_ascii(' '), attr);
+ grid_line_fill(col_off - pum_width + 1, grid_col + 1, schar_from_ascii(' '), orig_attr);
} else {
- grid_line_fill(grid_col, col_off + pum_width, schar_from_ascii(' '), attr);
+ grid_line_fill(grid_col, col_off + pum_width, schar_from_ascii(' '), orig_attr);
}
if (pum_scrollbar > 0) {