From 86ff391e9ed729914e0ab1f4893466858c225bd6 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 30 Nov 2024 16:16:28 -0600 Subject: [PATCH] plugins/dashboard: better rawLua support for header --- plugins/by-name/dashboard/default.nix | 2 +- .../plugins/by-name/dashboard/default.nix | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/plugins/by-name/dashboard/default.nix b/plugins/by-name/dashboard/default.nix index ad3d5725..571d9d05 100644 --- a/plugins/by-name/dashboard/default.nix +++ b/plugins/by-name/dashboard/default.nix @@ -246,7 +246,7 @@ helpers.neovim-plugin.mkNeovimPlugin { }; header = - helpers.defaultNullOpts.mkListOf types.str + helpers.defaultNullOpts.mkNullableWithRaw (with types; either str (listOf (maybeRaw str))) [ "" " ██████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ █████╗ ██████╗ ██████╗ " diff --git a/tests/test-sources/plugins/by-name/dashboard/default.nix b/tests/test-sources/plugins/by-name/dashboard/default.nix index 971a4941..0e85acd7 100644 --- a/tests/test-sources/plugins/by-name/dashboard/default.nix +++ b/tests/test-sources/plugins/by-name/dashboard/default.nix @@ -203,4 +203,50 @@ }; }; }; + + header-raw = { + plugins.dashboard = { + enable = true; + + settings.config.header.__raw = '' + function() + return { + "", + " ██████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ █████╗ ██████╗ ██████╗ ", + " ██╔══██╗██╔══██╗██╔════╝██║ ██║██╔══██╗██╔═══██╗██╔══██╗██╔══██╗██╔══██╗ ", + " ██║ ██║███████║███████╗███████║██████╔╝██║ ██║███████║██████╔╝██║ ██║ ", + " ██║ ██║██╔══██║╚════██║██╔══██║██╔══██╗██║ ██║██╔══██║██╔══██╗██║ ██║ ", + " ██████╔╝██║ ██║███████║██║ ██║██████╔╝╚██████╔╝██║ ██║██║ ██║██████╔╝ ", + " ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ", + "" + } + end + ''; + }; + }; + + header-line-raw = { + plugins.dashboard = { + enable = true; + + settings.config.header = [ + { + __raw = '' + function() + return { + "", + " ██████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ █████╗ ██████╗ ██████╗ ", + " ██╔══██╗██╔══██╗██╔════╝██║ ██║██╔══██╗██╔═══██╗██╔══██╗██╔══██╗██╔══██╗ ", + " ██║ ██║███████║███████╗███████║██████╔╝██║ ██║███████║██████╔╝██║ ██║ ", + " ██║ ██║██╔══██║╚════██║██╔══██║██╔══██╗██║ ██║██╔══██║██╔══██╗██║ ██║ ", + " ██████╔╝██║ ██║███████║██║ ██║██████╔╝╚██████╔╝██║ ██║██║ ██║██████╔╝ ", + " ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ", + "" + } + end + ''; + } + ]; + }; + }; }