From 431d6e775a7fb7e80389d999f840f3f88ac8ca90 Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 11 Oct 2023 07:34:40 -0400 Subject: [PATCH] fix(extension): Fix which-key toplevel group parsing --- lua/legendary/extensions/which_key.lua | 2 +- lua/legendary/util/which_key.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/legendary/extensions/which_key.lua b/lua/legendary/extensions/which_key.lua index cde0f2a..9e715bd 100644 --- a/lua/legendary/extensions/which_key.lua +++ b/lua/legendary/extensions/which_key.lua @@ -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 diff --git a/lua/legendary/util/which_key.lua b/lua/legendary/util/which_key.lua index b447586..8abb684 100644 --- a/lua/legendary/util/which_key.lua +++ b/lua/legendary/util/which_key.lua @@ -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