aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/extmark.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-03-06 21:45:26 +0000
committerGitHub <noreply@github.com>2022-03-06 22:45:26 +0100
commit8e7446b3cbc5c82706f41d701239fa18ab5b2808 (patch)
treea017f9b8440060f6597b183d1b297f0facb69f2f /src/nvim/extmark.c
parent54000170205b684cfb91bd178fba5d3486fb3313 (diff)
downloadrneovim-8e7446b3cbc5c82706f41d701239fa18ab5b2808.tar.gz
rneovim-8e7446b3cbc5c82706f41d701239fa18ab5b2808.tar.bz2
rneovim-8e7446b3cbc5c82706f41d701239fa18ab5b2808.zip
refactor(signcol): smarter invalidation (#17533)
Previously b_signcols was invalidated whenever a sign was added/removed or when a buffer line was added/removed. This change introduces a sentinel linenr_T into the buffer state which is a line number used to determine the signcolumn. With this information, we can invalidate the signcolumn less often. Now the signcolumn is only invalidated when a sign or line at the sentinel line number is removed.
Diffstat (limited to 'src/nvim/extmark.c')
-rw-r--r--src/nvim/extmark.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c
index e1f1ed7d13..2916e3e978 100644
--- a/src/nvim/extmark.c
+++ b/src/nvim/extmark.c
@@ -147,6 +147,10 @@ revised:
if (decor_has_sign(decor)) {
buf->b_signs++;
}
+ if (decor->sign_text) {
+ // TODO(lewis6991): smarter invalidation
+ buf_signcols_add_check(buf, NULL);
+ }
decor_redraw(buf, row, end_row > -1 ? end_row : row, decor);
}