Skip to content

Commit

Permalink
fix: cmd can be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Apr 28, 2021
1 parent b3357de commit 060a574
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/which-key/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ function M.get_mappings(mode, prefix, buf)
value.label = value.label:gsub("^%+", "")
value.label = Config.options.icons.group .. value.label
else
local clean_value_cmd = value.cmd
for i,v in ipairs(Config.options.hidden) do
clean_value_cmd = clean_value_cmd:gsub(v, "")
if not value.label then
value.label = value.cmd or ""
for _, v in ipairs(Config.options.hidden) do value.label = value.label:gsub(v, "") end
end
value.label = value.label or clean_value_cmd
end
table.insert(tmp, value)
end
Expand Down

0 comments on commit 060a574

Please sign in to comment.