From 8e7446b3cbc5c82706f41d701239fa18ab5b2808 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 6 Mar 2022 21:45:26 +0000 Subject: 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. --- src/nvim/extmark.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/extmark.c') 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); } -- cgit