aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-07-17 17:26:14 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-07-17 17:26:14 +0300
commit0660d8c97d42c951d6b59702915dc668246124bc (patch)
tree014add32cd892b3a3ebd78486ffcfd2e546fc383 /internal/p10k.zsh
parent2ca0ef4493abcde9e25a6abce9fc73c1c0394d52 (diff)
bug fix: %-expand POWERLEVEL9K_TIME_FORMAT on every prompt
reported in #77
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-xinternal/p10k.zsh13
1 files changed, 7 insertions, 6 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 171b6b7d..7ce19414 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1903,17 +1903,18 @@ prompt_time() {
if (( ! $+_P9K_TIME_TEXT )); then
if [[ $POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME == true ]]; then
_p9k_escape $POWERLEVEL9K_TIME_FORMAT
- _P9K_TIME_TEXT=$_P9K_RETVAL
+ _P9K_TIME_TEXT=("" "$_P9K_RETVAL")
else
- _p9k_escape ${${(%)POWERLEVEL9K_TIME_FORMAT}//\%/%%}
- _P9K_TIME_TEXT=$_P9K_RETVAL
+ _p9k_escape $POWERLEVEL9K_TIME_FORMAT
if [[ $POWERLEVEL9K_TIME_UPDATE_ON_COMMAND == true ]]; then
- _p9k_escape $POWERLEVEL9K_TIME_FORMAT
- _P9K_TIME_TEXT=\${_P9K_LINE_FINISH-$_P9K_TIME_TEXT}\${_P9K_LINE_FINISH+$_P9K_RETVAL}
+ _P9K_TIME_TEXT=("\${_P9K_LINE_FINISH-$_P9K_RETVAL}" "\${_P9K_LINE_FINISH+$_P9K_RETVAL}")
+ else
+ _P9K_TIME_TEXT=("$_P9K_RETVAL" "")
fi
fi
fi
- "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "TIME_ICON" 1 '' "$_P9K_TIME_TEXT"
+ "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "TIME_ICON" 1 '' \
+ "${(%)_P9K_TIME_TEXT[1]//\%/%%}${_P9K_TIME_TEXT[2]}"
}
################################################################