From 8e01af1a2f3ec1daab23b1b4377ac5257110ad10 Mon Sep 17 00:00:00 2001 From: connorgmeean Date: Thu, 22 Sep 2022 16:22:15 +1000 Subject: [PATCH] fix(whichkey): Not showing all keymaps --- lua/doom/modules/features/whichkey/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/doom/modules/features/whichkey/init.lua b/lua/doom/modules/features/whichkey/init.lua index c09f37eb8..e50c5d327 100644 --- a/lua/doom/modules/features/whichkey/init.lua +++ b/lua/doom/modules/features/whichkey/init.lua @@ -98,10 +98,11 @@ whichkey.configs["which-key.nvim"] = function() keymaps[v] = {} end -- If this is a keymap group - if type(node.rhs) == "table" then + local rhs_type = type(node.rhs) + if rhs_type == "table" then keymaps[v][node.lhs] = { name = node.name } -- If this is an actual keymap - elseif type(node.rhs) == "string" then + elseif rhs_type == "string" or rhs_type == "function" then keymaps[v][node.lhs] = { node.name } end end @@ -111,6 +112,7 @@ whichkey.configs["which-key.nvim"] = function() for k, v in pairs(keymaps) do require("which-key").register(v, { mode = k }) end + keymaps = {} end return module