diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-07-26 16:01:31 +0100 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-07-27 14:10:30 +0100 |
commit | 6162c937abbf80195ccab3daeb7ecdeb6ab24b52 (patch) | |
tree | ee089e91e05e586d38abb497b1257011ca23eff2 /src/nvim/drawline.c | |
parent | 8bdfc2ab2b2565f06d41921d57a0c6184a097271 (diff) | |
download | rneovim-6162c937abbf80195ccab3daeb7ecdeb6ab24b52.tar.gz rneovim-6162c937abbf80195ccab3daeb7ecdeb6ab24b52.tar.bz2 rneovim-6162c937abbf80195ccab3daeb7ecdeb6ab24b52.zip |
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.
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r-- | src/nvim/drawline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 579b237af6..14b3b3e693 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -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; |