mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 15:37:24 +00:00
hg prompt: Fix indentation
This commit is contained in:
parent
9a7b2b190b
commit
c3971957ac
1 changed files with 25 additions and 25 deletions
|
@ -21,34 +21,34 @@ set -g fish_prompt_hg_status_unmerged '!'
|
|||
set -g fish_prompt_hg_status_order added modified copied deleted untracked unmerged
|
||||
|
||||
function __fish_hg_prompt --description 'Write out the hg prompt'
|
||||
# If hg isn't installed, there's nothing we can do
|
||||
# Return 1 so the calling prompt can deal with it
|
||||
if not command -s hg >/dev/null
|
||||
return 1
|
||||
end
|
||||
|
||||
# Find an hg directory above $PWD
|
||||
# without calling `hg root` because that's too slow
|
||||
set -l root
|
||||
set -l dir $PWD
|
||||
while test $dir != "/"
|
||||
if test -f $dir'/.hg/dirstate'
|
||||
set root $dir"/.hg"
|
||||
break
|
||||
end
|
||||
# Go up one directory
|
||||
set -l dir (string replace -r '[^/]*/?$' '' $dir)
|
||||
# If hg isn't installed, there's nothing we can do
|
||||
# Return 1 so the calling prompt can deal with it
|
||||
if not command -s hg > /dev/null
|
||||
return 1
|
||||
end
|
||||
|
||||
if test -z "$root"
|
||||
return 0
|
||||
end
|
||||
# Find an hg directory above $PWD
|
||||
# without calling `hg root` because that's too slow
|
||||
set -l root
|
||||
set -l dir $PWD
|
||||
while test $dir != "/"
|
||||
if test -f $dir'/.hg/dirstate'
|
||||
set root $dir"/.hg"
|
||||
break
|
||||
end
|
||||
# Go up one directory
|
||||
set -l dir (string replace -r '[^/]*/?$' '' $dir)
|
||||
end
|
||||
|
||||
# Read branch and bookmark
|
||||
if test -z "$root"
|
||||
return 0
|
||||
end
|
||||
|
||||
# Read branch and bookmark
|
||||
set -l branch (cat $root/branch ^/dev/null; or echo default)
|
||||
if set -l bookmark (cat $root/bookmarks.current ^/dev/null)
|
||||
set branch "$branch|$bookmark"
|
||||
end
|
||||
if set -l bookmark (cat $root/bookmarks.current ^/dev/null)
|
||||
set branch "$branch|$bookmark"
|
||||
end
|
||||
|
||||
echo -n '|'
|
||||
|
||||
|
@ -60,7 +60,7 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
|
|||
echo -n "($branch)"'✓'
|
||||
set_color normal
|
||||
|
||||
# Handle modified or dirty (unknown state)
|
||||
# Handle modified or dirty (unknown state)
|
||||
else
|
||||
set -l hg_statuses
|
||||
|
||||
|
|
Loading…
Reference in a new issue