mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-12 19:18:28 +02:00
Use defined to set right, left prompt elements.
This commit is contained in:
parent
b19de85c16
commit
893bfe243d
@ -669,9 +669,7 @@ prompt_virtualenv() {
|
|||||||
|
|
||||||
# Main prompt
|
# Main prompt
|
||||||
build_left_prompt() {
|
build_left_prompt() {
|
||||||
if [[ "${#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS}" == 0 ]]; then
|
defined POWERLEVEL9K_LEFT_PROMPT_ELEMENTS || POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs)
|
||||||
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs)
|
|
||||||
fi
|
|
||||||
|
|
||||||
for element in $POWERLEVEL9K_LEFT_PROMPT_ELEMENTS; do
|
for element in $POWERLEVEL9K_LEFT_PROMPT_ELEMENTS; do
|
||||||
prompt_$element "left"
|
prompt_$element "left"
|
||||||
@ -684,9 +682,7 @@ build_left_prompt() {
|
|||||||
build_right_prompt() {
|
build_right_prompt() {
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
|
|
||||||
if [[ "${#POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS}" == 0 ]]; then
|
defined POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(longstatus history time)
|
||||||
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(longstatus history time)
|
|
||||||
fi
|
|
||||||
|
|
||||||
for element in $POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS; do
|
for element in $POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS; do
|
||||||
prompt_$element "right"
|
prompt_$element "right"
|
||||||
|
Loading…
Reference in New Issue
Block a user