diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-02-28 12:38:33 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-02-28 13:11:36 +0100 |
commit | 7e19cabeb192d2e7f20d7bb965a3f62e1543d2ac (patch) | |
tree | be9412eb7ba7423462e05d5fd290b1b1679be006 /runtime/lua/vim/lsp/semantic_tokens.lua | |
parent | a87b52d328d5f78965d6eaff7efab7b63069bdc0 (diff) | |
download | rneovim-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 'runtime/lua/vim/lsp/semantic_tokens.lua')
-rw-r--r-- | runtime/lua/vim/lsp/semantic_tokens.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua index 00b4757ea9..24b5c6c24e 100644 --- a/runtime/lua/vim/lsp/semantic_tokens.lua +++ b/runtime/lua/vim/lsp/semantic_tokens.lua @@ -334,7 +334,8 @@ function STHighlighter:process_response(response, client, version) current_result.highlights = tokens_to_ranges(tokens, self.bufnr, client) current_result.namespace_cleared = false - api.nvim_command('redraw!') + -- redraw all windows displaying buffer + api.nvim__buf_redraw_range(self.bufnr, 0, -1) end --- on_win handler for the decoration provider (see |nvim_set_decoration_provider|) |