From 1b96dab8770067899524b98abe33b723c5075078 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Wed, 22 May 2024 19:58:01 +0200 Subject: [PATCH] noice: add filter --- modules/plugins/ui/noice/noice.nix | 35 ++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/modules/plugins/ui/noice/noice.nix b/modules/plugins/ui/noice/noice.nix index d1e3970..f3af447 100644 --- a/modules/plugins/ui/noice/noice.nix +++ b/modules/plugins/ui/noice/noice.nix @@ -4,7 +4,7 @@ ... }: let inherit (lib.options) mkEnableOption mkOption; - inherit (lib.types) anything nullOr; + inherit (lib.types) anything nullOr listOf submodule str; inherit (lib.nvim.types) mkPluginSetupOption; inherit (lib.nvim.config) mkBool; in { @@ -102,7 +102,38 @@ in { }; }; - # TODO: messages, routes + routes = mkOption { + description = "How to route messages"; + type = listOf (submodule { + options = { + view = mkOption { + description = ""; + type = str; + }; + + filter = mkOption { + description = ""; + type = anything; + }; + + opts = mkOption { + description = ""; + type = nullOr anything; + }; + }; + }); + + default = [ + { + filter = { + event = "msg_show"; + kind = ""; + find = "written"; + }; + opts = {skip = true;}; + } + ]; + }; }; }; }