mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 12:28:18 +00:00

committed by
Justin M. Keyes

parent
cf202b74db
commit
43a99f77a8
@@ -2193,7 +2193,8 @@ win_line (
|
|||||||
int prev_c1 = 0; /* first composing char for prev_c */
|
int prev_c1 = 0; /* first composing char for prev_c */
|
||||||
int did_line_attr = 0;
|
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
|
int bufhl_attr = 0; // attributes desired by bufhl
|
||||||
bufhl_lineinfo_T bufhl_info; // bufhl data for this line
|
bufhl_lineinfo_T bufhl_info; // bufhl data for this line
|
||||||
|
|
||||||
@@ -2625,6 +2626,7 @@ win_line (
|
|||||||
if ((long)shl->startcol < v) { // match at leftcol
|
if ((long)shl->startcol < v) { // match at leftcol
|
||||||
shl->attr_cur = shl->attr;
|
shl->attr_cur = shl->attr;
|
||||||
search_attr = shl->attr;
|
search_attr = shl->attr;
|
||||||
|
search_attr_from_match = shl != &search_hl;
|
||||||
}
|
}
|
||||||
area_highlighting = true;
|
area_highlighting = true;
|
||||||
}
|
}
|
||||||
@@ -2962,6 +2964,7 @@ win_line (
|
|||||||
|
|
||||||
/* Use attributes from match with highest priority among
|
/* Use attributes from match with highest priority among
|
||||||
* 'search_hl' and the match list. */
|
* 'search_hl' and the match list. */
|
||||||
|
search_attr_from_match = false;
|
||||||
search_attr = search_hl.attr_cur;
|
search_attr = search_hl.attr_cur;
|
||||||
cur = wp->w_match_head;
|
cur = wp->w_match_head;
|
||||||
shl_flag = FALSE;
|
shl_flag = FALSE;
|
||||||
@@ -2974,8 +2977,10 @@ win_line (
|
|||||||
shl_flag = TRUE;
|
shl_flag = TRUE;
|
||||||
} else
|
} else
|
||||||
shl = &cur->hl;
|
shl = &cur->hl;
|
||||||
if (shl->attr_cur != 0)
|
if (shl->attr_cur != 0) {
|
||||||
search_attr = shl->attr_cur;
|
search_attr = shl->attr_cur;
|
||||||
|
search_attr_from_match = shl != &search_hl;
|
||||||
|
}
|
||||||
if (shl != &search_hl && cur != NULL)
|
if (shl != &search_hl && cur != NULL)
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
}
|
}
|
||||||
@@ -3711,7 +3716,7 @@ win_line (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Don't override visual selection highlighting.
|
// 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);
|
char_attr = hl_combine_attr(char_attr, extra_attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -401,7 +401,7 @@ describe('guisp (special/undercurl)', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe("'cursorline' with 'listchars'", function()
|
describe("'listchars' highlight", function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@@ -644,4 +644,41 @@ describe("'cursorline' with 'listchars'", function()
|
|||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("'cursorline' with :match", function()
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[0] = {bold=true, foreground=Screen.colors.Blue},
|
||||||
|
[1] = {background=Screen.colors.Grey90},
|
||||||
|
[2] = {foreground=Screen.colors.Red},
|
||||||
|
[3] = {foreground=Screen.colors.Green1},
|
||||||
|
})
|
||||||
|
execute('highlight clear ModeMsg')
|
||||||
|
execute('highlight SpecialKey guifg=#FF0000')
|
||||||
|
execute('highlight Error guifg=#00FF00')
|
||||||
|
execute('set nowrap')
|
||||||
|
feed('ia \t bc \t <esc>')
|
||||||
|
screen:expect([[
|
||||||
|
a bc ^ |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
execute('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
|
||||||
|
screen:expect([[
|
||||||
|
a{2:.>-----.}bc{2:*>---*^*}{0:¬} |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
execute('match Error /\\s\\+$/')
|
||||||
|
screen:expect([[
|
||||||
|
a{2:.>-----.}bc{3:*>---*^*}{0:¬} |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user