mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-12-29 06:02:23 +00:00
keymaps: fix null key problems
This commit is contained in:
parent
66d0a81206
commit
745da4539e
2 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@
|
||||||
mapConfigOptions
|
mapConfigOptions
|
||||||
// {
|
// {
|
||||||
key = mkOption {
|
key = mkOption {
|
||||||
type = str;
|
type = nullOr str;
|
||||||
description = "The key that triggers this keybind.";
|
description = "The key that triggers this keybind.";
|
||||||
};
|
};
|
||||||
mode = mkOption {
|
mode = mkOption {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) map mapAttrs filter;
|
inherit (builtins) map mapAttrs filter;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.strings) concatLines concatMapStringsSep optionalString;
|
inherit (lib.strings) concatLines concatMapStringsSep;
|
||||||
inherit (lib.trivial) showWarnings;
|
inherit (lib.trivial) showWarnings;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere;
|
inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere;
|
||||||
|
@ -43,7 +43,7 @@ in {
|
||||||
|
|
||||||
toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})";
|
toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})";
|
||||||
|
|
||||||
keymaps = concatLines (map toLuaKeymap cfg.keymaps);
|
keymaps = concatLines (map toLuaKeymap (filter (x: x.key != null) cfg.keymaps));
|
||||||
in {
|
in {
|
||||||
vim = {
|
vim = {
|
||||||
luaConfigRC = {
|
luaConfigRC = {
|
||||||
|
|
Loading…
Reference in a new issue