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 ''
|
callback = lib.nixvim.mkRaw ''
|
||||||
function(args)
|
function(args)
|
||||||
local __keymaps = ${
|
local __keymaps = ${
|
||||||
lib.nixvim.lua.toLua' {
|
lib.pipe cfg.keymaps [
|
||||||
multiline = true;
|
(map (keymap: {
|
||||||
indent = " ";
|
inherit (keymap)
|
||||||
} cfg.keymaps
|
mode
|
||||||
|
key
|
||||||
|
action
|
||||||
|
options
|
||||||
|
;
|
||||||
|
}))
|
||||||
|
(lib.nixvim.lua.toLua' {
|
||||||
|
multiline = true;
|
||||||
|
indent = " ";
|
||||||
|
})
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, keymap in ipairs(__keymaps) do
|
for _, keymap in ipairs(__keymaps) do
|
||||||
|
|
|
||||||
|
|
@ -86,13 +86,11 @@
|
||||||
{
|
{
|
||||||
action = vim.lsp.buf["definition"],
|
action = vim.lsp.buf["definition"],
|
||||||
key = "gd",
|
key = "gd",
|
||||||
lspBufAction = "definition",
|
|
||||||
mode = ""
|
mode = ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
action = vim.lsp.buf["hover"],
|
action = vim.lsp.buf["hover"],
|
||||||
key = "K",
|
key = "K",
|
||||||
lspBufAction = "hover",
|
|
||||||
mode = ""
|
mode = ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue