fix: improve which-key integration with set_mappings
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user