aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-02-28 12:38:33 +0100
committerbfredl <bjorn.linse@gmail.com>2023-02-28 13:11:36 +0100
commit7e19cabeb192d2e7f20d7bb965a3f62e1543d2ac (patch)
treebe9412eb7ba7423462e05d5fd290b1b1679be006 /src/nvim/api/buffer.c
parenta87b52d328d5f78965d6eaff7efab7b63069bdc0 (diff)
downloadrneovim-7e19cabeb192d2e7f20d7bb965a3f62e1543d2ac.tar.gz
rneovim-7e19cabeb192d2e7f20d7bb965a3f62e1543d2ac.tar.bz2
rneovim-7e19cabeb192d2e7f20d7bb965a3f62e1543d2ac.zip
perf(lsp): only redraw the windows containing LSP tokens
redraw! redraws the entire screen instead of just the windows with the buffer which were actually changed. I considered trying to calculating the range for the delta but it looks tricky. Could a follow-up.
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index bbdb66988b..ca3cf76388 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -248,6 +248,9 @@ void nvim__buf_redraw_range(Buffer buffer, Integer first, Integer last, Error *e
if (!buf) {
return;
}
+ if (last < 0) {
+ last = buf->b_ml.ml_line_count;
+ }
redraw_buf_range_later(buf, (linenr_T)first + 1, (linenr_T)last);
}