0
0
mirror of https://github.com/vim/vim.git synced 2025-10-22 08:34:29 -04:00

patch 9.1.0936: cannot highlight completed text

Problem:  cannot highlight completed text
Solution: (optionally) highlight auto-completed text using the
          ComplMatchIns highlight group (glepnir)

closes: #16173

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2024-12-16 21:56:16 +01:00
committed by Christian Brabandt
parent 368ef5a48c
commit 6a38aff218
17 changed files with 208 additions and 22 deletions

View File

@@ -1139,6 +1139,7 @@ win_line(
long vcol_prev = -1; // "wlv.vcol" of previous character
char_u *line; // current line
char_u *ptr; // current position in "line"
int in_curline = wp == curwin && lnum == curwin->w_cursor.lnum;
#ifdef FEAT_PROP_POPUP
char_u *p_extra_free2 = NULL; // another p_extra to be freed
@@ -1172,6 +1173,7 @@ win_line(
// highlighting
int area_attr = 0; // attributes desired by highlighting
int search_attr = 0; // attributes desired by 'hlsearch'
int ins_match_attr = 0; // attributes desired by PmenuMatch
#ifdef FEAT_SYN_HL
int vcol_save_attr = 0; // saved attr for 'cursorcolumn'
int syntax_attr = 0; // attributes desired by syntax
@@ -1415,8 +1417,7 @@ win_line(
}
// Check if the character under the cursor should not be inverted
if (!highlight_match && lnum == curwin->w_cursor.lnum
&& wp == curwin
if (!highlight_match && in_curline
#ifdef FEAT_GUI
&& !gui.in_use
#endif
@@ -3939,6 +3940,14 @@ win_line(
if (wlv.draw_state == WL_LINE)
vcol_prev = wlv.vcol;
if (wlv.draw_state == WL_LINE
&& (State & MODE_INSERT) && in_curline && ins_compl_active())
{
ins_match_attr = ins_compl_col_range_attr(wlv.col);
if (ins_match_attr > 0)
wlv.char_attr = hl_combine_attr(wlv.char_attr, ins_match_attr);
}
// Store character to be displayed.
// Skip characters that are left of the screen for 'nowrap'.
if (wlv.draw_state < WL_LINE || skip_cells <= 0)