Keywords and options recently got dedicated highlighting roles in
b3626d48e (Highlight keywords differently, 2021-02-04) and
711796ad1 (Highlight options differently, 2021-10-19)
but still default to "command" and "parameter", respectively.
The dedicated roles were not colored by our CSS theme,
which makes a "test -f foo.txt" look weird:
- "test" is dark blue (since it's a command)
- "foo.txt" is light blue (since it's a parameter)
- "-f" is black (weird!)
The CSS theme doesn't support configuration, so the dedicated
highlighting roles should always default to their fallback
options. Make it so.
This introduces a new variable, $fish_color_option, that can be used
to highlight options differently.
Options are tokens starting with `-`, but only up to (and including!)
the first `--`.
Fixes#8292.
This introduces a new variable $fish_color_keyword that will be used
to highlight keywords. If it's not defined, we fall back on
$fish_color_command as before.
An issue here is that most of our keywords have this weird duality of
also being builtins *if* executed without an argument or with
`--help`.
This means that e.g.
if
is highlighted as a command until you start typing
if t
and then it turns keyword.