From 656bb1879951a73454db517b30c00cc7e788f84d Mon Sep 17 00:00:00 2001 From: Warren Young Date: Tue, 30 Aug 2022 00:49:05 -0600 Subject: [PATCH] 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. --- plugins/fossil/fossil.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/fossil/fossil.plugin.zsh b/plugins/fossil/fossil.plugin.zsh index a2123f415..28cf2c915 100644 --- a/plugins/fossil/fossil.plugin.zsh +++ b/plugins/fossil/fossil.plugin.zsh @@ -1,16 +1,16 @@ _FOSSIL_PROMPT="" # 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 ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})" # Text to display if the branch is dirty -ZSH_THEME_FOSSIL_PROMPT_DIRTY=" %{$fg_bold[red]%}✖" +ZSH_THEME_FOSSIL_PROMPT_DIRTY="%{$fg_bold[red]%}✖" # Text to display if the branch is clean -ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔" +ZSH_THEME_FOSSIL_PROMPT_CLEAN="%{$fg_bold[green]%}✔" function fossil_prompt_info() { local info=$(fossil branch 2>&1) @@ -26,11 +26,11 @@ function fossil_prompt_info() { dirty="$ZSH_THEME_FOSSIL_PROMPT_DIRTY" fi - printf '%s %s %s %s %s' \ + printf ' %s%s%s%s%s' \ "$ZSH_THEME_FOSSIL_PROMPT_PREFIX" \ "${branch:gs/%/%%}" \ - "$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \ "$dirty" \ + "$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \ "%{$reset_color%}" }