fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes Altmanningerthemes/default: revert to palette colors for now4bb0d956e

master
869 B27 linesraw
1# localization: skip(private)
2
3function __fish_theme_for_each
4    set -l callback $argv[1]
5    set -l theme_names $argv[2..]
6    for theme_name in (
7        set -l matching_names (__fish_theme_names $theme_names)
8        if not set -q theme_names[1]
9            echo default
10            echo default-rgb
11            string match -rv -- '^(default|default-rgb)$' $matching_names
12        else
13            string join -- \n $matching_names
14        end
15    )
16        set -l theme_data (__fish_theme_cat $theme_name)
17        set -l color_themes (string split -- \n $theme_data |
18            string replace -rf -- '^\[(dark|light|unknown)\]$' '$1')
19        if not set -q color_themes[1]
20            set color_themes unknown
21        end
22        $callback \
23            --name=$theme_name \
24            --data=$theme_data \
25            --color-themes=$color_themes
26    end
27end