From 97eed79568ad34e4e009090f0bdfc419b648fa62 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 2 Feb 2024 23:22:04 +0100 Subject: [PATCH] modules/keymaps: allow action.__raw --- lib/keymap-helpers.nix | 2 +- tests/test-sources/modules/keymaps.nix | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/keymap-helpers.nix b/lib/keymap-helpers.nix index 64effebc..0dcbca36 100644 --- a/lib/keymap-helpers.nix +++ b/lib/keymap-helpers.nix @@ -105,7 +105,7 @@ in rec { }; action = mkOption ({ - type = str; + type = helpers.nixvimTypes.maybeRaw str; description = "The action to execute."; } // ( diff --git a/tests/test-sources/modules/keymaps.nix b/tests/test-sources/modules/keymaps.nix index 9afa0de0..de3c1063 100644 --- a/tests/test-sources/modules/keymaps.nix +++ b/tests/test-sources/modules/keymaps.nix @@ -26,6 +26,11 @@ key = ","; action = "echo \"test\""; } + { + # raw action using rawType + key = ""; + action.__raw = "function() print('hello') end"; + } { key = ""; action = "function() print('toto') end";