mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
fix(extmarks): don't show virt lines for end mark (#23792)
This commit is contained in:
parent
f29acc5073
commit
4dd43e31db
@ -603,7 +603,7 @@ int decor_virt_lines(win_T *wp, linenr_T lnum, VirtLines *lines, TriState has_fo
|
||||
mtkey_t mark = marktree_itr_current(itr);
|
||||
if (mark.pos.row < 0 || mark.pos.row >= end_row) {
|
||||
break;
|
||||
} else if (marktree_decor_level(mark) < kDecorLevelVirtLine) {
|
||||
} else if (mt_end(mark) || marktree_decor_level(mark) < kDecorLevelVirtLine) {
|
||||
goto next_mark;
|
||||
}
|
||||
bool above = mark.pos.row > (lnum - 2);
|
||||
|
@ -2978,6 +2978,30 @@ if (h->n_buckets < new_n_buckets) { // expand
|
||||
]]}
|
||||
end)
|
||||
|
||||
it('does not show twice if end_row or end_col is specified #18622', function()
|
||||
insert([[
|
||||
aaa
|
||||
bbb
|
||||
ccc
|
||||
ddd]])
|
||||
meths.buf_set_extmark(0, ns, 0, 0, {end_row = 2, virt_lines = {{{'VIRT LINE 1', 'NonText'}}}})
|
||||
meths.buf_set_extmark(0, ns, 3, 0, {end_col = 2, virt_lines = {{{'VIRT LINE 2', 'NonText'}}}})
|
||||
screen:expect{grid=[[
|
||||
aaa |
|
||||
{1:VIRT LINE 1} |
|
||||
bbb |
|
||||
ccc |
|
||||
dd^d |
|
||||
{1:VIRT LINE 2} |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]]}
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
describe('decorations: signs', function()
|
||||
|
Loading…
Reference in New Issue
Block a user