mirror of
https://github.com/romkatv/powerlevel10k
synced 2024-12-11 16:45:36 +00:00
For left aligned segments start the foreground color after the visual
identifier has been printed.
This commit is contained in:
parent
c5726bc548
commit
6f7d6f7259
@ -142,7 +142,7 @@ left_prompt_segment() {
|
|||||||
[[ -n $3 ]] && fg="%F{$3}" || fg="%f"
|
[[ -n $3 ]] && fg="%F{$3}" || fg="%f"
|
||||||
if [[ $CURRENT_BG != 'NONE' ]] && ! isSameColor "$2" "$CURRENT_BG"; then
|
if [[ $CURRENT_BG != 'NONE' ]] && ! isSameColor "$2" "$CURRENT_BG"; then
|
||||||
# Middle segment
|
# Middle segment
|
||||||
echo -n "%{$bg%F{$CURRENT_BG}%}$(print_icon 'LEFT_SEGMENT_SEPARATOR')%{$fg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
|
echo -n "%{$bg%F{$CURRENT_BG}%}$(print_icon 'LEFT_SEGMENT_SEPARATOR')$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
|
||||||
elif isSameColor "$CURRENT_BG" "$2"; then
|
elif isSameColor "$CURRENT_BG" "$2"; then
|
||||||
# Middle segment with same color as previous segment
|
# Middle segment with same color as previous segment
|
||||||
# We take the current foreground color as color for our
|
# We take the current foreground color as color for our
|
||||||
@ -150,10 +150,10 @@ left_prompt_segment() {
|
|||||||
# enough contrast.
|
# enough contrast.
|
||||||
local complement
|
local complement
|
||||||
[[ -n $3 ]] && complement=$3 || complement=$DEFAULT_COLOR
|
[[ -n $3 ]] && complement=$3 || complement=$DEFAULT_COLOR
|
||||||
echo -n "%{$bg%F{$complement}%}$(print_icon 'LEFT_SUBSEGMENT_SEPARATOR')%{$fg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
|
echo -n "%{$bg%F{$complement}%}$(print_icon 'LEFT_SUBSEGMENT_SEPARATOR')$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
|
||||||
else
|
else
|
||||||
# First segment
|
# First segment
|
||||||
echo -n "%{$bg%}%{$fg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
|
echo -n "%{$bg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local visual_identifier
|
local visual_identifier
|
||||||
@ -167,7 +167,7 @@ left_prompt_segment() {
|
|||||||
[[ -n $4 ]] && visual_identifier="$visual_identifier "
|
[[ -n $4 ]] && visual_identifier="$visual_identifier "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "$visual_identifier$4$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
|
echo -n "$visual_identifier%{$fg%}$4$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
|
||||||
CURRENT_BG=$2
|
CURRENT_BG=$2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user