Skip to content

Commit

Permalink
diff/highlight: do not overlay low-priority CursorLine
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmk committed Oct 31, 2018
1 parent 61fccda commit be9de88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/nvim/highlight_defs.h
Expand Up @@ -22,7 +22,7 @@ typedef enum {
/// Stores a complete highlighting entry, including colors and attributes
/// for both TUI and GUI.
typedef struct attr_entry {
int16_t rgb_ae_attr, cterm_ae_attr; // HL_BOLD, etc.
int16_t rgb_ae_attr, cterm_ae_attr; ///< HlAttrFlags
RgbValue rgb_fg_color, rgb_bg_color, rgb_sp_color;
int cterm_fg_color, cterm_bg_color;
} HlAttrs;
Expand Down Expand Up @@ -94,8 +94,8 @@ typedef enum {
, HLF_TP // tabpage line
, HLF_TPS // tabpage line selected
, HLF_TPF // tabpage line filler
, HLF_CUC // 'cursurcolumn'
, HLF_CUL // 'cursurline'
, HLF_CUC // 'cursorcolumn'
, HLF_CUL // 'cursorline'
, HLF_MC // 'colorcolumn'
, HLF_QFL // selected quickfix line
, HLF_0 // Whitespace
Expand Down
5 changes: 3 additions & 2 deletions src/nvim/screen.c
Expand Up @@ -2829,7 +2829,7 @@ win_line (
draw_state = WL_BRI - 1;
}

// draw 'breakindent': indent wrapped text accodringly
// draw 'breakindent': indent wrapped text accordingly
if (draw_state == WL_BRI - 1 && n_extra == 0) {
draw_state = WL_BRI;
// if need_showbreak is set, breakindent also applies
Expand Down Expand Up @@ -3055,7 +3055,8 @@ win_line (
diff_hlf = HLF_CHD; // changed line
}
line_attr = win_hl_attr(wp, diff_hlf);
if (wp->w_p_cul && lnum == wp->w_cursor.lnum) {
// 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));
}
}
Expand Down
1 change: 1 addition & 0 deletions src/nvim/syntax.c
Expand Up @@ -61,6 +61,7 @@ struct hl_group {
scid_T sg_scriptID; ///< script in which the group was last set
// for terminal UIs
int sg_cterm; ///< "cterm=" highlighting attr
///< (combination of \ref HlAttrFlags)
int sg_cterm_fg; ///< terminal fg color number + 1
int sg_cterm_bg; ///< terminal bg color number + 1
bool sg_cterm_bold; ///< bold attr was set for light color
Expand Down

0 comments on commit be9de88

Please sign in to comment.