From 707bfe3ce6b04470c86af1022421048ac01e37f4 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 25 Nov 2025 12:52:39 +0100 Subject: [PATCH] fish_config theme show: list default scheme first Webconfig does the same ("Add the current scheme first, then the default."). --- share/functions/__fish_theme_for_each.fish | 10 +++++++++- tests/checks/fish_config.fish | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_theme_for_each.fish b/share/functions/__fish_theme_for_each.fish index 844ead781..7c7acc383 100644 --- a/share/functions/__fish_theme_for_each.fish +++ b/share/functions/__fish_theme_for_each.fish @@ -3,7 +3,15 @@ function __fish_theme_for_each set -l callback $argv[1] set -l theme_names $argv[2..] - for theme_name in (__fish_theme_names $theme_names) + for theme_name in ( + set -l matching_names (__fish_theme_names $theme_names) + if not set -q theme_names[1] + echo default + string match -v -- default $matching_names + else + string join -- \n $matching_names + end + ) set -l theme_data (__fish_theme_cat $theme_name) $callback \ --name=$theme_name \ diff --git a/tests/checks/fish_config.fish b/tests/checks/fish_config.fish index 38ef3aae3..fb1827ee9 100644 --- a/tests/checks/fish_config.fish +++ b/tests/checks/fish_config.fish @@ -149,11 +149,11 @@ fish_config theme show ayu-dark ayu-light | string match -r '^.*ayu.*' mkdir $__fish_config_dir/themes touch $__fish_config_dir/themes/custom-from-userconf.theme fish_config theme show | grep -E '[^-]default|base16-default-dark|custom-from-userconf' +# CHECK: {{.*}}default{{\x1b\[m}} # CHECK: {{.*}}custom-from-userconf{{\x1b\[m}} # CHECK: {{.*}}base16-default-dark{{\x1b\[m}} # CHECK: {{.*}}default-dark{{\x1b\[m}} # CHECK: {{.*}}default-light{{\x1b\[m}} -# CHECK: {{.*}}default{{\x1b\[m}} # Override a default theme with different colors. __fish_data_with_file themes/none.theme \