fish: better handle prompt_sep being disabled
This commit is contained in:
parent
dbdfd8d0bf
commit
dd31f8bba1
2 changed files with 9 additions and 5 deletions
|
@ -1,10 +1,14 @@
|
|||
function prompt.add
|
||||
set color $argv[1]
|
||||
set text $argv[2]
|
||||
set -l color $argv[1]
|
||||
set -l text $argv[2]
|
||||
set -l sep ''
|
||||
if test -n "$prompt_sep"
|
||||
set sep (set_color $prev_color)$prompt_sep(set_color $color_fg)
|
||||
set prev_color $color
|
||||
end
|
||||
if test -z "$prompt_string"
|
||||
set prompt_string (set_color -b $color)(set_color $color_fg) $text
|
||||
else
|
||||
set -a prompt_string (set_color -b $color)(set_color $prev_color)$prompt_sep_a(set_color $color_fg) $text
|
||||
set -a prompt_string (set_color -b $color)$sep $text
|
||||
end
|
||||
set prev_color $color
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue