Skip to content

Commit

Permalink
fix: handle keymaps with a <nop> rhs as non existing and possibly ove…
Browse files Browse the repository at this point in the history
…rwrite them with WK hooks #35
  • Loading branch information
folke committed May 5, 2021
1 parent d155ab3 commit 402be18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/which-key/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ function M.update_keymaps(mode, buf)
for _, keymap in pairs(keymaps) do
local skip = M.is_hook(keymap.lhs, keymap.rhs)

if not skip and Util.t(keymap.rhs) == "" then skip = true end

-- check if <leader> was remapped
if not skip and Util.t(keymap.lhs) == Util.t("<leader>") then
if Util.t(keymap.rhs) == "" then
Expand Down

1 comment on commit 402be18

@klooj
Copy link

@klooj klooj commented on 402be18 May 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are my hero. i think this plugin is officially perfect now.

Please sign in to comment.