feat(functions): derive the shared help palette from the fish theme

__fish_palette's c_cmd/c_flag/c_arg/c_dim now read fish's own highlighter
variables (fish_color_command/option/param/autosuggestion) when set, and
c_head reads the pager's fish_pager_color_prefix, so --help text matches
whatever the user's actual theme renders at the prompt instead of a fixed
guess at it. Each role keeps its previous static value as a fallback
(e.g. a --no-config script, or the theme variable being unset or empty).

Routes __fish_help_header's title/section colors and config-help's,
gi's, and git-clean's own hand-rolled --help blocks through the palette
instead of their hardcoded set_color calls, which fixes the
--help-vs-actual-prompt color mismatch across most of the config's
functions in one place (__fish_help_header backs the majority of
user-facing --help output).

Also fixes role mismatches found along the way: several already-palette
functions (dockup, fish-deps, pkg, play-media, dng2avif) were coloring
their <placeholder>/[bracket] argument text with c_dim instead of c_arg,
and scrub's "Aggressive Targets:" heading was still a hardcoded
set_color call sitting next to an otherwise-converted help block.
This commit is contained in:
2026-09-21 01:19:38 -04:00
parent 02c060f9f1
commit 610714476d
11 changed files with 103 additions and 96 deletions
+2 -2
View File
@@ -42,12 +42,12 @@ function play-media --description 'Pick audio/video files with fzf and play them
or return 1
if set -q _flag_help
echo "$c_head""Usage:$c_reset $c_cmd""play-media$c_reset $c_flag""[-p|--player$c_reset $c_dim<cmd>$c_reset""$c_flag]$c_reset"
echo "$c_head""Usage:$c_reset $c_cmd""play-media$c_reset $c_flag""[-p|--player$c_reset $c_arg<cmd>$c_reset""$c_flag]$c_reset"
echo
echo " Pick audio/video files under the current directory with fzf and play them."
echo
echo "$c_head""Options:$c_reset"
echo " $c_flag-p$c_reset, $c_flag--player$c_reset $c_dim<cmd>$c_reset Force a specific player command"
echo " $c_flag-p$c_reset, $c_flag--player$c_reset $c_arg<cmd>$c_reset Force a specific player command"
echo " $c_flag-h$c_reset, $c_flag--help$c_reset Show this help"
return 0
end