aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-12-06 13:34:19 +0100
committerLewis Russell <me@lewisr.dev>2023-12-07 14:22:24 +0000
commit4a34da82c18e6da1e46d6bf3d21082a6b6c8b947 (patch)
tree0f9b6b45e4aa4a757526e6727ca9943b8170ba87 /src/nvim/api/vim.c
parente42f03264b424450b560a69994879f09b6c555d8 (diff)
downloadrneovim-4a34da82c18e6da1e46d6bf3d21082a6b6c8b947.tar.gz
rneovim-4a34da82c18e6da1e46d6bf3d21082a6b6c8b947.tar.bz2
rneovim-4a34da82c18e6da1e46d6bf3d21082a6b6c8b947.zip
perf(column): keep track of number of lines that hold up the 'signcolumn'
Problem: The entire marktree needs to be traversed each time a sign is removed from the sentinel line. Solution: Remove sentinel line and instead keep track of the number of lines that hold up the 'signcolumn' in "max_count". Adjust this number for added/removed signs, and set it to 0 when the maximum number of signs on a line changes. Only when "max_count" is decremented to 0 due to sign removal do we need to check the entire buffer. Also replace "invalid_top" and "invalid_bot" with a map of invalid ranges, further reducing the number of lines to be checked. Also improve tree traversal when counting the number of signs. Instead of looping over the to be checked range and counting the overlap for each row, keep track of the overlap in an array and add this to the count.
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 0842469c59..2c937113e3 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -2189,7 +2189,6 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
int cul_id = 0;
int num_id = 0;
linenr_T lnum = statuscol_lnum;
- wp->w_scwidth = win_signcol_count(wp);
decor_redraw_signs(wp, wp->w_buffer, lnum - 1, sattrs, &line_id, &cul_id, &num_id);
statuscol.sattrs = sattrs;