Reduced unnecessary space in Fossil plugin prompt

The prior version was way too opinionated, adding space between each element of the prompt string, unlike common Git prompt strings.  If the user wants more space, they can override our public variables to suit.  The inverse argument doesn't hold: it's easy to add space to existing variables, but not as easy to remove it after the fact.

As part of this, changed the branch name from red to blue (matching the preceding part of the prompt) so the red "X" added to indicate a dirty branch doesn't get lost in the branch name.
This commit is contained in:
Warren Young 2022-08-30 00:49:05 -06:00
parent 6d48309cd7
commit 656bb18799

View file

@ -1,7 +1,7 @@
_FOSSIL_PROMPT="" _FOSSIL_PROMPT=""
# Prefix at the very beginning of the prompt, before the branch name # Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_FOSSIL_PROMPT_PREFIX="%{$fg_bold[blue]%}fossil:(%{$fg_bold[red]%}" ZSH_THEME_FOSSIL_PROMPT_PREFIX="%{$fg_bold[blue]%}fossil:("
# At the very end of the prompt # At the very end of the prompt
ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})" ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})"
@ -29,8 +29,8 @@ function fossil_prompt_info() {
printf ' %s%s%s%s%s' \ printf ' %s%s%s%s%s' \
"$ZSH_THEME_FOSSIL_PROMPT_PREFIX" \ "$ZSH_THEME_FOSSIL_PROMPT_PREFIX" \
"${branch:gs/%/%%}" \ "${branch:gs/%/%%}" \
"$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \
"$dirty" \ "$dirty" \
"$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \
"%{$reset_color%}" "%{$reset_color%}"
} }