aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/highlight.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-03 18:02:25 +0800
committerGitHub <noreply@github.com>2024-05-03 18:02:25 +0800
commitd44ed3a885e163df33cce8180ca9f72fb5c0661a (patch)
tree48c5c793cc69a1bf35c712885bf123e7654e37d7 /runtime/lua/vim/highlight.lua
parentcf9f002f31c8b4d9d42912a3f45f5d3db4462fd9 (diff)
downloadrneovim-d44ed3a885e163df33cce8180ca9f72fb5c0661a.tar.gz
rneovim-d44ed3a885e163df33cce8180ca9f72fb5c0661a.tar.bz2
rneovim-d44ed3a885e163df33cce8180ca9f72fb5c0661a.zip
perf(extmarks): better track whether namespace has extmarks (#28615)
This avoids redraw when adding/removing an empty namespace for a window. This also avoids marktree traversal when clearing a namespace that has already been cleared, which is added as a benchmark.
Diffstat (limited to 'runtime/lua/vim/highlight.lua')
-rw-r--r--runtime/lua/vim/highlight.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/highlight.lua b/runtime/lua/vim/highlight.lua
index cdc0f0a0b1..781fabe5fb 100644
--- a/runtime/lua/vim/highlight.lua
+++ b/runtime/lua/vim/highlight.lua
@@ -129,13 +129,13 @@ function M.on_yank(opts)
yank_cancel()
end
+ vim.api.nvim_win_add_ns(winid, yank_ns)
M.range(bufnr, yank_ns, higroup, "'[", "']", {
regtype = event.regtype,
inclusive = event.inclusive,
priority = opts.priority or M.priorities.user,
_scoped = true,
})
- vim.api.nvim_win_add_ns(winid, yank_ns)
yank_cancel = function()
yank_timer = nil