mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 13:08:33 +00:00
diff/highlight: Show underline for low-priority CursorLine
This commit is contained in:
@@ -177,6 +177,24 @@ void update_window_hl(win_T *wp, bool invalid)
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets HL_UNDERLINE highlight.
|
||||
int hl_get_underline(void)
|
||||
{
|
||||
return get_attr_entry((HlEntry){
|
||||
.attr = (HlAttrs){
|
||||
.cterm_ae_attr = (int16_t)HL_UNDERLINE,
|
||||
.cterm_fg_color = 0,
|
||||
.cterm_bg_color = 0,
|
||||
.rgb_ae_attr = (int16_t)HL_UNDERLINE,
|
||||
.rgb_fg_color = 0,
|
||||
.rgb_bg_color = 0,
|
||||
},
|
||||
.kind = kHlUI,
|
||||
.id1 = 0,
|
||||
.id2 = 0,
|
||||
});
|
||||
}
|
||||
|
||||
/// Get attribute code for forwarded :terminal highlights.
|
||||
int hl_get_term_attr(HlAttrs *aep)
|
||||
{
|
||||
|
@@ -3052,9 +3052,13 @@ win_line (
|
||||
diff_hlf = HLF_CHD; // changed line
|
||||
}
|
||||
line_attr = win_hl_attr(wp, diff_hlf);
|
||||
// Overlay CursorLine onto diff highlight, unless it's low-priority.
|
||||
if (!line_attr_lowprio && wp->w_p_cul && lnum == wp->w_cursor.lnum) {
|
||||
line_attr = hl_combine_attr(line_attr, win_hl_attr(wp, HLF_CUL));
|
||||
// Overlay CursorLine onto diff-mode highlight.
|
||||
if (wp->w_p_cul && lnum == wp->w_cursor.lnum) {
|
||||
line_attr = 0 != line_attr_lowprio // Low-priority CursorLine
|
||||
? hl_combine_attr(hl_combine_attr(win_hl_attr(wp, HLF_CUL),
|
||||
line_attr),
|
||||
hl_get_underline())
|
||||
: hl_combine_attr(line_attr, win_hl_attr(wp, HLF_CUL));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user