diff --git a/plugins/utils/which-key.nix b/plugins/utils/which-key.nix index ea2520d3..a0c93262 100644 --- a/plugins/utils/which-key.nix +++ b/plugins/utils/which-key.nix @@ -14,7 +14,7 @@ with lib; { package = helpers.mkPackageOption "whick-key-nvim" pkgs.vimPlugins.which-key-nvim; registrations = mkOption { - type = with types; attrsOf str; + type = with types; attrsOf anything; default = {}; description = "Manually register the description of mappings."; example = { diff --git a/tests/test-sources/plugins/utils/which-key.nix b/tests/test-sources/plugins/utils/which-key.nix index 6ac2f971..be5bfda7 100644 --- a/tests/test-sources/plugins/utils/which-key.nix +++ b/tests/test-sources/plugins/utils/which-key.nix @@ -7,8 +7,38 @@ plugins.which-key = { enable = true; - # Simple mapping with only Description - registrations."ff" = "Test"; + # Testing for registrations + registrations."f" = { + prefix = ""; + mode = ["n" "v" "i" "t" "c" "x" "s" "o"]; + name = "Group Test"; + f = "Label Test"; + "1" = [ + { + __raw = '' + function() + print("Raw Lua Code and List KeyMapping Test") + end + ''; + } + "Raw Lua Code and List KeyMapping Test" + ]; + "oo" = "Label Test 2"; + "" = { + name = "Group in Group Test"; + f = [ + { + __raw = '' + function() + vim.cmd("echo 'Raw Lua Code and List KeyMapping Test 2'") + end + ''; + } + + "Raw Lua Code and List KeyMapping Test 2" + ]; + }; + }; plugins = { marks = true;