toggleterm: use toLuaObject for clarity

This commit is contained in:
Ching Pei Yang 2024-10-31 13:58:59 +01:00
parent 7543cc2725
commit 11e0b9a031
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -3,12 +3,12 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) toJSON;
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
inherit (lib.lists) optional; inherit (lib.lists) optional;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.nvim.binds) mkLznBinding; inherit (lib.nvim.binds) mkLznBinding;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.terminal.toggleterm; cfg = config.vim.terminal.toggleterm;
lazygitMapDesc = "Open lazygit [toggleterm]"; lazygitMapDesc = "Open lazygit [toggleterm]";
@ -42,7 +42,7 @@ in {
end end
}) })
vim.keymap.set('n', ${toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = '${lazygitMapDesc}'}) vim.keymap.set('n', ${toLuaObject cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = '${lazygitMapDesc}'})
''; '';
}; };
}; };