Skip to content

Commit

Permalink
fix(extension): Fix which-key toplevel group parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Oct 11, 2023
1 parent df21595 commit 431d6e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/legendary/extensions/which_key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ return function(opts)
local original = wk.register
local listener = function(whichkey_tbls, whichkey_opts)
Log.trace('Preparing to register items from which-key.nvim automatically')
util.bind_whichkey(whichkey_tbls, whichkey_opts, false, opts.use_groups)
util.bind_whichkey(whichkey_tbls, whichkey_opts, opts.do_binding, opts.use_groups)
original(whichkey_tbls, whichkey_opts)
Log.trace('Successfully registered items from which-key.nvim')
end
Expand Down
2 changes: 1 addition & 1 deletion lua/legendary/util/which_key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local M = {}
local function longest_matching_group(wk, wk_groups)
local matching_group = {}
for prefix, group_data in pairs(wk_groups) do
if vim.startswith(wk.prefix, prefix) and #prefix > #(matching_group[1] or '') then
if prefix == '' or vim.startswith(wk.prefix, prefix) and #prefix > #(matching_group[1] or '') then
matching_group = { prefix, group_data }
end
end
Expand Down

0 comments on commit 431d6e7

Please sign in to comment.