diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-08-16 15:27:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-16 00:27:04 -0700 |
commit | e9dd640897e6a318d770be62bbcc9f417f95990e (patch) | |
tree | 99b0190164906c9c62e53907bc04128be439c488 /src/nvim/screen.c | |
parent | 54726e8bb9f7d33ad0a603d82b408cb571c2a7a3 (diff) | |
download | rneovim-e9dd640897e6a318d770be62bbcc9f417f95990e.tar.gz rneovim-e9dd640897e6a318d770be62bbcc9f417f95990e.tar.bz2 rneovim-e9dd640897e6a318d770be62bbcc9f417f95990e.zip |
vim-patch:8.2.3295: 'cursorline' should not apply to 'breakindent' #15281
Problem: 'cursorline' should not apply to 'breakindent'.
Solution: Make 'cursorline' apply to 'breakindent' and 'showbreak'
consistently. (closes vim/vim#8684)
https://github.com/vim/vim/commit/4f33bc20d7d5444e44d13f954e8219ad1abd26ef
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 38ed2816ba..2275a0255d 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2381,13 +2381,12 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, && wp->w_p_culopt_flags != CULOPT_NBR) { cul_screenline = (wp->w_p_wrap && (wp->w_p_culopt_flags & CULOPT_SCRLINE)); - cul_attr = win_hl_attr(wp, HLF_CUL); - HlAttrs ae = syn_attr2entry(cul_attr); - - // We make a compromise here (#7383): - // * low-priority CursorLine if fg is not set - // * high-priority ("same as Vim" priority) CursorLine if fg is set if (!cul_screenline) { + cul_attr = win_hl_attr(wp, HLF_CUL); + HlAttrs ae = syn_attr2entry(cul_attr); + // We make a compromise here (#7383): + // * low-priority CursorLine if fg is not set + // * high-priority ("same as Vim" priority) CursorLine if fg is set if (ae.rgb_fg_color == -1 && ae.cterm_fg_color == 0) { line_attr_lowprio = cul_attr; } else { @@ -2399,7 +2398,6 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, } } } else { - cul_attr = 0; margin_columns_win(wp, &left_curline_col, &right_curline_col); } area_highlighting = true; @@ -2700,6 +2698,12 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, // Skip this quickly when working on the text. if (draw_state != WL_LINE) { + if (cul_screenline) { + cul_attr = 0; + line_attr = line_attr_save; + line_attr_lowprio = line_attr_lowprio_save; + } + if (draw_state == WL_CMDLINE - 1 && n_extra == 0) { draw_state = WL_CMDLINE; if (cmdwin_type != 0 && wp == curwin) { @@ -2855,9 +2859,6 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, if (diff_hlf != (hlf_T)0) { char_attr = win_hl_attr(wp, diff_hlf); - if (cul_attr) { - char_attr = hl_combine_attr(char_attr, cul_attr); - } } p_extra = NULL; c_extra = ' '; @@ -2943,21 +2944,20 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, } } - if (cul_screenline) { - if (draw_state == WL_LINE - && vcol >= left_curline_col - && vcol < right_curline_col) { - cul_attr = win_hl_attr(wp, HLF_CUL); - HlAttrs ae = syn_attr2entry(cul_attr); - if (ae.rgb_fg_color == -1 && ae.cterm_fg_color == 0) { - line_attr_lowprio = cul_attr; + if (cul_screenline && draw_state == WL_LINE + && vcol >= left_curline_col + && vcol < right_curline_col) { + cul_attr = win_hl_attr(wp, HLF_CUL); + HlAttrs ae = syn_attr2entry(cul_attr); + if (ae.rgb_fg_color == -1 && ae.cterm_fg_color == 0) { + line_attr_lowprio = cul_attr; + } else { + if (!(State & INSERT) && bt_quickfix(wp->w_buffer) + && qf_current_entry(wp) == lnum) { + line_attr = hl_combine_attr(cul_attr, line_attr); } else { line_attr = cul_attr; } - } else { - cul_attr = 0; - line_attr = line_attr_save; - line_attr_lowprio = line_attr_lowprio_save; } } |