aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index b98e59ed06..d9a21aa81f 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -2193,7 +2193,8 @@ win_line (
int prev_c1 = 0; /* first composing char for prev_c */
int did_line_attr = 0;
- bool has_bufhl = false; // this buffer has highlight matches
+ bool search_attr_from_match = false; // if search_attr is from :match
+ bool has_bufhl = false; // this buffer has highlight matches
int bufhl_attr = 0; // attributes desired by bufhl
bufhl_lineinfo_T bufhl_info; // bufhl data for this line
@@ -2625,6 +2626,7 @@ win_line (
if ((long)shl->startcol < v) { // match at leftcol
shl->attr_cur = shl->attr;
search_attr = shl->attr;
+ search_attr_from_match = shl != &search_hl;
}
area_highlighting = true;
}
@@ -2922,7 +2924,6 @@ win_line (
}
} else if (v == (long)shl->endcol) {
shl->attr_cur = 0;
- prev_syntax_id = 0;
next_search_hl(wp, shl, lnum, (colnr_T)v,
shl == &search_hl ? NULL : cur);
@@ -2963,6 +2964,7 @@ win_line (
/* Use attributes from match with highest priority among
* 'search_hl' and the match list. */
+ search_attr_from_match = false;
search_attr = search_hl.attr_cur;
cur = wp->w_match_head;
shl_flag = FALSE;
@@ -2975,8 +2977,10 @@ win_line (
shl_flag = TRUE;
} else
shl = &cur->hl;
- if (shl->attr_cur != 0)
+ if (shl->attr_cur != 0) {
search_attr = shl->attr_cur;
+ search_attr_from_match = shl != &search_hl;
+ }
if (shl != &search_hl && cur != NULL)
cur = cur->next;
}
@@ -3137,7 +3141,7 @@ win_line (
p_extra = extra;
c = *p_extra;
- mb_c = mb_ptr2char_adv(&p_extra);
+ mb_c = mb_ptr2char_adv((const char_u **)&p_extra);
mb_utf8 = (c >= 0x80);
n_extra = (int)STRLEN(p_extra);
c_extra = NUL;
@@ -3405,7 +3409,7 @@ win_line (
|| (c == ' ' && lcs_space && ptr - line <= trailcol))) {
c = (c == ' ') ? lcs_space : lcs_nbsp;
n_attr = 1;
- extra_attr = hl_attr(HLF_8);
+ extra_attr = hl_attr(HLF_0);
saved_attr2 = char_attr; // save current attr
mb_c = c;
if (enc_utf8 && (*mb_char2len)(c) > 1) {
@@ -3420,7 +3424,7 @@ win_line (
if (trailcol != MAXCOL && ptr > line + trailcol && c == ' ') {
c = lcs_trail;
n_attr = 1;
- extra_attr = hl_attr(HLF_8);
+ extra_attr = hl_attr(HLF_0);
saved_attr2 = char_attr; // save current attr
mb_c = c;
if (enc_utf8 && (*mb_char2len)(c) > 1) {
@@ -3521,8 +3525,8 @@ win_line (
c_extra = lcs_tab2;
}
n_attr = tab_len + 1;
- extra_attr = hl_attr(HLF_8);
- saved_attr2 = char_attr; /* save current attr */
+ extra_attr = hl_attr(HLF_0);
+ saved_attr2 = char_attr; // save current attr
mb_c = c;
if (enc_utf8 && (*mb_char2len)(c) > 1) {
mb_utf8 = TRUE;
@@ -3712,7 +3716,7 @@ win_line (
}
// Don't override visual selection highlighting.
- if (n_attr > 0 && draw_state == WL_LINE) {
+ if (n_attr > 0 && draw_state == WL_LINE && !search_attr_from_match) {
char_attr = hl_combine_attr(char_attr, extra_attr);
}
@@ -6885,7 +6889,10 @@ static void draw_tabline(void)
int use_sep_chars = (t_colors < 8
);
- redraw_tabline = FALSE;
+ if (ScreenLines == NULL) {
+ return;
+ }
+ redraw_tabline = false;
if (tabline_height() < 1)