mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-18 02:30:07 +00:00
Make check for segments in use take joined segments into account
This commit is contained in:
parent
690af685ef
commit
1015b38cf2
2 changed files with 5 additions and 6 deletions
|
@ -202,11 +202,10 @@ fi
|
||||||
# * $1: The segment to be tested.
|
# * $1: The segment to be tested.
|
||||||
segment_in_use() {
|
segment_in_use() {
|
||||||
local key=$1
|
local key=$1
|
||||||
if [[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)$key]}" ]] || [[ -n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)$key]}" ]]; then
|
[[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)${key}]}" ||
|
||||||
return 0
|
-n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)${key}_joined]}" ||
|
||||||
else
|
-n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)${key}]}" ||
|
||||||
return 1
|
-n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)${key}_joined]}" ]]
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print a deprecation warning if an old segment is in use.
|
# Print a deprecation warning if an old segment is in use.
|
||||||
|
|
|
@ -1910,7 +1910,7 @@ prompt_powerlevel9k_setup() {
|
||||||
# initialize colors
|
# initialize colors
|
||||||
autoload -U colors && colors
|
autoload -U colors && colors
|
||||||
|
|
||||||
if segment_in_use "vcs" || segment_in_use "vcs_joined"; then
|
if segment_in_use "vcs"; then
|
||||||
powerlevel9k_vcs_init
|
powerlevel9k_vcs_init
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue