mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +00:00
refactor(decor): decor_virt_lines()
Reduce calls to hasFolding() and remove the has_fold argument. For lines that don't have virtual lines this should be more efficient as it should avoid any calls to hasFolding(), whereas before it was called at least once for any buffer containing at least one virtual line. This will be slightly less efficient for lines with multiple virtual lines marks as hasFolding() is called once for each mark. This could be optimized, but having multiple virtual lines marks on a single line is very rare.
This commit is contained in:

committed by
Lewis Russell

parent
8bdfc2ab2b
commit
6162c937ab
@@ -1158,7 +1158,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
|
||||
area_highlighting = true;
|
||||
}
|
||||
VirtLines virt_lines = KV_INITIAL_VALUE;
|
||||
wlv.n_virt_lines = decor_virt_lines(wp, lnum, &virt_lines, has_fold);
|
||||
wlv.n_virt_lines = decor_virt_lines(wp, lnum, &virt_lines);
|
||||
wlv.filler_lines += wlv.n_virt_lines;
|
||||
if (lnum == wp->w_topline) {
|
||||
wlv.filler_lines = wp->w_topfill;
|
||||
|
Reference in New Issue
Block a user