Commit 72ee1140 authored by Lin Jen-Shin's avatar Lin Jen-Shin

themes/gitstatus: Fix where it shows extra a space

For example, if $HOME is not a git repository, it should show:

    ~>

But previously it incorrectly showed:

    ~ >

This commit makes it aware of such case, inserting the space
accordingly instead of always adding a space.
parent 0f3aff49
...@@ -28,8 +28,13 @@ end ...@@ -28,8 +28,13 @@ end
function fish_prompt function fish_prompt
set -l cyan (set_color cyan) set -l cyan (set_color cyan)
set -l normal (set_color normal) set -l normal (set_color normal)
set -l cwd (set_color $fish_color_cwd)(prompt_pwd) set -l cwd (set_color $fish_color_cwd)(prompt_pwd)
set -l git_status (_git_status_symbol)(_git_branch_name)
if test -n "$git_status"
set git_status " $git_status"
end
echo -n (_remote_hostname) \ echo -n (_remote_hostname) $cwd$cyan$git_status$normal'> '
$cwd $cyan(_git_status_symbol)(_git_branch_name)$normal'> '
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment