mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(drawline): check filler_todo in place of removed draw_state (#27889)
The only place it matters is the conceal wcol check, but it can avoid unnecessary computations at other places.
This commit is contained in:
parent
14e4b6bbd8
commit
34b57508a7
@ -1596,7 +1596,8 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cul_screenline && wlv.vcol >= left_curline_col && wlv.vcol < right_curline_col) {
|
if (cul_screenline && wlv.filler_todo <= 0
|
||||||
|
&& wlv.vcol >= left_curline_col && wlv.vcol < right_curline_col) {
|
||||||
apply_cursorline_highlight(wp, &wlv);
|
apply_cursorline_highlight(wp, &wlv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1623,7 +1624,8 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
int extmark_attr = 0;
|
int extmark_attr = 0;
|
||||||
if (area_highlighting || spv->spv_has_spell || extra_check) {
|
if (wlv.filler_todo <= 0
|
||||||
|
&& (area_highlighting || spv->spv_has_spell || extra_check)) {
|
||||||
if (wlv.n_extra == 0 || !wlv.extra_for_extmark) {
|
if (wlv.n_extra == 0 || !wlv.extra_for_extmark) {
|
||||||
wlv.reset_extra_attr = false;
|
wlv.reset_extra_attr = false;
|
||||||
}
|
}
|
||||||
@ -1654,11 +1656,9 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
|
|||||||
}
|
}
|
||||||
decor_need_recheck = false;
|
decor_need_recheck = false;
|
||||||
}
|
}
|
||||||
if (wlv.filler_todo <= 0) {
|
|
||||||
extmark_attr = decor_redraw_col(wp, (colnr_T)(ptr - line),
|
extmark_attr = decor_redraw_col(wp, (colnr_T)(ptr - line),
|
||||||
may_have_inline_virt ? -3 : wlv.off,
|
may_have_inline_virt ? -3 : wlv.off,
|
||||||
selected, &decor_state);
|
selected, &decor_state);
|
||||||
}
|
|
||||||
if (may_have_inline_virt) {
|
if (may_have_inline_virt) {
|
||||||
handle_inline_virtual_text(wp, &wlv, ptr - line, selected);
|
handle_inline_virtual_text(wp, &wlv, ptr - line, selected);
|
||||||
if (wlv.n_extra > 0 && wlv.virt_inline_hl_mode <= kHlModeReplace) {
|
if (wlv.n_extra > 0 && wlv.virt_inline_hl_mode <= kHlModeReplace) {
|
||||||
@ -2443,7 +2443,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
|
|||||||
// the cursor column when we reach its position.
|
// the cursor column when we reach its position.
|
||||||
// With 'virtualedit' we may never reach cursor position, but we still
|
// With 'virtualedit' we may never reach cursor position, but we still
|
||||||
// need to correct the cursor column, so do that at end of line.
|
// need to correct the cursor column, so do that at end of line.
|
||||||
if (!did_wcol
|
if (!did_wcol && wlv.filler_todo <= 0
|
||||||
&& wp == curwin && lnum == wp->w_cursor.lnum
|
&& wp == curwin && lnum == wp->w_cursor.lnum
|
||||||
&& conceal_cursor_line(wp)
|
&& conceal_cursor_line(wp)
|
||||||
&& (wlv.vcol + wlv.skip_cells >= wp->w_virtcol || mb_schar == NUL)) {
|
&& (wlv.vcol + wlv.skip_cells >= wp->w_virtcol || mb_schar == NUL)) {
|
||||||
@ -2705,10 +2705,14 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wlv.filler_todo <= 0) {
|
||||||
// Apply lowest-priority line attr now, so everything can override it.
|
// Apply lowest-priority line attr now, so everything can override it.
|
||||||
wlv.char_attr = hl_combine_attr(wlv.line_attr_lowprio, wlv.char_attr);
|
wlv.char_attr = hl_combine_attr(wlv.line_attr_lowprio, wlv.char_attr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wlv.filler_todo <= 0) {
|
||||||
vcol_prev = wlv.vcol;
|
vcol_prev = wlv.vcol;
|
||||||
|
}
|
||||||
|
|
||||||
// Store character to be displayed.
|
// Store character to be displayed.
|
||||||
// Skip characters that are left of the screen for 'nowrap'.
|
// Skip characters that are left of the screen for 'nowrap'.
|
||||||
|
@ -4065,6 +4065,8 @@ describe('decorations: virtual lines', function()
|
|||||||
[7] = {foreground = Screen.colors.SlateBlue};
|
[7] = {foreground = Screen.colors.SlateBlue};
|
||||||
[8] = {background = Screen.colors.WebGray, foreground = Screen.colors.DarkBlue};
|
[8] = {background = Screen.colors.WebGray, foreground = Screen.colors.DarkBlue};
|
||||||
[9] = {foreground = Screen.colors.Brown};
|
[9] = {foreground = Screen.colors.Brown};
|
||||||
|
[10] = {bold = true, reverse = true};
|
||||||
|
[11] = {reverse = true};
|
||||||
}
|
}
|
||||||
|
|
||||||
ns = api.nvim_create_namespace 'test'
|
ns = api.nvim_create_namespace 'test'
|
||||||
@ -4860,6 +4862,22 @@ if (h->n_buckets < new_n_buckets) { // expand
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('does not break cursor position with concealcursor #27887', function()
|
||||||
|
command('vsplit')
|
||||||
|
insert('\n')
|
||||||
|
api.nvim_set_option_value('conceallevel', 2, {})
|
||||||
|
api.nvim_set_option_value('concealcursor', 'niv', {})
|
||||||
|
api.nvim_buf_set_extmark(0, ns, 0, 0, { virt_lines = {{{'VIRT1'}}, {{'VIRT2'}}} })
|
||||||
|
screen:expect([[
|
||||||
|
│ |
|
||||||
|
VIRT1 │VIRT1 |
|
||||||
|
VIRT2 │VIRT2 |
|
||||||
|
^ │ |
|
||||||
|
{1:~ }│{1:~ }|*6
|
||||||
|
{10:[No Name] [+] }{11:[No Name] [+] }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('decorations: signs', function()
|
describe('decorations: signs', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user