Make purpose clear of backgroundColor and foregroundColor functions
The functions just start the colors, they do not end them. It seems too much to have a function that terminates a color.
This commit is contained in:
parent
345cf87b8f
commit
ebbdb3c1c0
2 changed files with 8 additions and 16 deletions
|
@ -127,8 +127,8 @@ left_prompt_segment() {
|
|||
[[ -n $FG_COLOR_MODIFIER ]] && 4="$FG_COLOR_MODIFIER"
|
||||
|
||||
local bg fg
|
||||
[[ -n "$3" ]] && bg="$(backgroundColor $3)" || bg="$(backgroundColor)"
|
||||
[[ -n "$4" ]] && fg="$(foregroundColor $4)" || fg="$(foregroundColor)"
|
||||
[[ -n "$3" ]] && bg="$(backgroundColor $3)" || bg="%k"
|
||||
[[ -n "$4" ]] && fg="$(foregroundColor $4)" || fg="%f"
|
||||
|
||||
if [[ $CURRENT_BG != 'NONE' ]] && ! isSameColor "$3" "$CURRENT_BG"; then
|
||||
echo -n "$bg%F{$CURRENT_BG}"
|
||||
|
@ -220,8 +220,8 @@ right_prompt_segment() {
|
|||
[[ -n $FG_COLOR_MODIFIER ]] && 4="$FG_COLOR_MODIFIER"
|
||||
|
||||
local bg fg
|
||||
[[ -n "$3" ]] && bg="$(backgroundColor $3)" || bg="$(backgroundColor)"
|
||||
[[ -n "$4" ]] && fg="$(foregroundColor $4)" || fg="$(foregroundColor)"
|
||||
[[ -n "$3" ]] && bg="$(backgroundColor $3)" || bg="%k"
|
||||
[[ -n "$4" ]] && fg="$(foregroundColor $4)" || fg="%f"
|
||||
|
||||
# If CURRENT_RIGHT_BG is "NONE", we are the first right segment.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue