fix: improve which-key integration with set_mappings

This commit is contained in:
Micah Halter
2023-07-03 20:55:25 -04:00
parent cd81a45c1d
commit 5a65b9dd75
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -277,6 +277,7 @@ function M.set_mappings(map_table, base)
keymap_opts[1] = nil
end
if not cmd or keymap_opts.name then -- if which-key mapping, queue it
if not keymap_opts.name then keymap_opts.name = keymap_opts.desc end
if not M.which_key_queue then M.which_key_queue = {} end
if not M.which_key_queue[mode] then M.which_key_queue[mode] = {} end
M.which_key_queue[mode][keymap] = keymap_opts
+1 -1
View File
@@ -368,7 +368,7 @@ M.on_attach = function(client, bufnr)
end
if not vim.tbl_isempty(lsp_mappings.v) then
lsp_mappings.v["<leader>l"] = { desc = (vim.g.icons_enabled and "" or "") .. "LSP" }
lsp_mappings.v["<leader>l"] = { desc = utils.get_icon("ActiveLSP", 1, true) .. "LSP" }
end
utils.set_mappings(user_opts("lsp.mappings", lsp_mappings), { buffer = bufnr })