forked from aniani/vim
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Problem: Cannot adjust sign highlighting for 'cursorline'. Solution: Add CursorLineSign and CursorLineFold highlight groups. (Gregory Anders, closes #9201)
This commit is contained in:
@@ -76,6 +76,17 @@ margin_columns_win(win_T *wp, int *left_col, int *right_col)
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SIGNS
|
||||
/*
|
||||
* Return TRUE if CursorLineSign highlight is to be used.
|
||||
*/
|
||||
static int
|
||||
use_cursor_line_sign(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
return wp->w_p_cul
|
||||
&& lnum == wp->w_cursor.lnum
|
||||
&& (wp->w_p_culopt_flags & CULOPT_NBR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get information needed to display the sign in line 'lnum' in window 'wp'.
|
||||
* If 'nrcol' is TRUE, the sign is going to be displayed in the number column.
|
||||
@@ -85,7 +96,7 @@ margin_columns_win(win_T *wp, int *left_col, int *right_col)
|
||||
get_sign_display_info(
|
||||
int nrcol,
|
||||
win_T *wp,
|
||||
linenr_T lnum UNUSED,
|
||||
linenr_T lnum,
|
||||
sign_attrs_T *sattr,
|
||||
int wcr_attr,
|
||||
int row,
|
||||
@@ -111,7 +122,10 @@ get_sign_display_info(
|
||||
*n_extrap = number_width(wp) + 1;
|
||||
else
|
||||
{
|
||||
*char_attrp = hl_combine_attr(wcr_attr, HL_ATTR(HLF_SC));
|
||||
if (use_cursor_line_sign(wp, lnum))
|
||||
*char_attrp = hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLS));
|
||||
else
|
||||
*char_attrp = hl_combine_attr(wcr_attr, HL_ATTR(HLF_SC));
|
||||
*n_extrap = 2;
|
||||
}
|
||||
|
||||
@@ -176,7 +190,11 @@ get_sign_display_info(
|
||||
*c_finalp = NUL;
|
||||
*n_extrap = (int)STRLEN(*pp_extra);
|
||||
}
|
||||
*char_attrp = sattr->sat_texthl;
|
||||
|
||||
if (use_cursor_line_sign(wp, lnum) && sattr->sat_culhl > 0)
|
||||
*char_attrp = sattr->sat_culhl;
|
||||
else
|
||||
*char_attrp = sattr->sat_texthl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1051,7 +1069,12 @@ win_line(
|
||||
p_extra = p_extra_free;
|
||||
c_extra = NUL;
|
||||
c_final = NUL;
|
||||
char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_FC));
|
||||
if (use_cursor_line_sign(wp, lnum))
|
||||
char_attr =
|
||||
hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLF));
|
||||
else
|
||||
char_attr =
|
||||
hl_combine_attr(wcr_attr, HL_ATTR(HLF_FC));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user