diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-05-03 18:02:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 18:02:25 +0800 |
commit | d44ed3a885e163df33cce8180ca9f72fb5c0661a (patch) | |
tree | 48c5c793cc69a1bf35c712885bf123e7654e37d7 /runtime/lua/vim/highlight.lua | |
parent | cf9f002f31c8b4d9d42912a3f45f5d3db4462fd9 (diff) | |
download | rneovim-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.lua | 2 |
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 |