From d44ed3a885e163df33cce8180ca9f72fb5c0661a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 3 May 2024 18:02:25 +0800 Subject: 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. --- runtime/lua/vim/highlight.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim') 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 -- cgit