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:
committed by
Christian Brabandt
parent
368ef5a48c
commit
6a38aff218
@@ -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)
|
||||
|
Reference in New Issue
Block a user