Skip to content

Commit

Permalink
perf: no need to hook buffer-local if we have a global hook for a cer…
Browse files Browse the repository at this point in the history
…tain prefix
  • Loading branch information
folke committed Apr 30, 2021
1 parent 334fcca commit bb5e0d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/which-key/keys.lua
Expand Up @@ -258,7 +258,7 @@ function M.hook_add(prefix, mode, buf, secret_only)

local opts = { noremap = true, silent = true }
local id = M.hook_id(prefix, mode, buf)
local id_global = nil -- M.hook_id(prefix, mode)
local id_global = M.hook_id(prefix, mode)
-- hook up if needed
if not M.hooked[id] and not M.hooked[id_global] then
local cmd = [[<cmd>lua require("which-key").show(%q, {mode = %q, auto = true})<cr>]]
Expand Down

0 comments on commit bb5e0d9

Please sign in to comment.