Skip to content

Commit

Permalink
fix: never hook numbers. locks up due to v:count. Fixes #118
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 5, 2021
1 parent 29a82b5 commit 2d2954a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lua/which-key/keys.lua
Expand Up @@ -331,6 +331,10 @@ function M.hook_add(prefix, mode, buf, secret_only)
if M.blacklist[mode] and M.blacklist[mode][prefix] then
return
end
-- don't hook numbers. See #118
if tonumber(prefix) then
return
end
-- don't hook to j or k in INSERT mode
if mode == "i" and (prefix == "j" or prefix == "k") then
return
Expand Down Expand Up @@ -532,12 +536,14 @@ function M.update_keymaps(mode, buf)
if Util.t(keymap.rhs) == "" then
skip = true
else
Util.warn(string.format(
"Your <leader> key for %q mode in buf %d is currently mapped to %q. WhichKey automatically creates triggers, so please remove the mapping",
mode,
buf or 0,
keymap.rhs
))
Util.warn(
string.format(
"Your <leader> key for %q mode in buf %d is currently mapped to %q. WhichKey automatically creates triggers, so please remove the mapping",
mode,
buf or 0,
keymap.rhs
)
)
end
end

Expand Down

0 comments on commit 2d2954a

Please sign in to comment.