mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-08 19:46:06 +01:00
modules/lsp: select relevant fields in keymaps table
We only use `mode`, `key`, `action`, and `options`; so explicitly inherit those. This means we don't serialise attrs that aren't needed at runtime, such as `lspBufAction`.
This commit is contained in:
parent
f421af99fe
commit
cb3653a1a8
2 changed files with 14 additions and 6 deletions
|
|
@ -105,10 +105,20 @@ in
|
|||
callback = lib.nixvim.mkRaw ''
|
||||
function(args)
|
||||
local __keymaps = ${
|
||||
lib.nixvim.lua.toLua' {
|
||||
multiline = true;
|
||||
indent = " ";
|
||||
} cfg.keymaps
|
||||
lib.pipe cfg.keymaps [
|
||||
(map (keymap: {
|
||||
inherit (keymap)
|
||||
mode
|
||||
key
|
||||
action
|
||||
options
|
||||
;
|
||||
}))
|
||||
(lib.nixvim.lua.toLua' {
|
||||
multiline = true;
|
||||
indent = " ";
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
for _, keymap in ipairs(__keymaps) do
|
||||
|
|
|
|||
|
|
@ -86,13 +86,11 @@
|
|||
{
|
||||
action = vim.lsp.buf["definition"],
|
||||
key = "gd",
|
||||
lspBufAction = "definition",
|
||||
mode = ""
|
||||
},
|
||||
{
|
||||
action = vim.lsp.buf["hover"],
|
||||
key = "K",
|
||||
lspBufAction = "hover",
|
||||
mode = ""
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue