aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-02-10 16:33:09 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-02-10 16:33:09 +0300
commit47400657ecd94dd2cc4681f5a31c483386d4f391 (patch)
tree16b28d582b8e4729a839a77e11d87527ff30872b /internal/p10k.zsh
parent30a54b1d5e90288b19deb7b4703f8bef883c4091 (diff)
don't persist fprint cache
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh21
1 files changed, 13 insertions, 8 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index df96b6d1..cfd5fcf4 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -443,12 +443,17 @@ _p9k_cache_stat_get() {
fi
done
- if _p9k_cache_get $0 $label meta "$@" && [[ $_p9k__cache_val[1] == $_p9k__cache_stat_meta ]]; then
- _p9k__cache_stat_fprint=$_p9k__cache_val[2]
- local -a key=($0 $label fprint "$@" "$_p9k__cache_stat_fprint")
- _p9k__cache_fprint_key="${(pj:\0:)key}"
- shift 2 _p9k__cache_val
- return 0
+ if _p9k_cache_get $0 $label meta "$@"; then
+ if [[ $_p9k__cache_val[1] == $_p9k__cache_stat_meta ]]; then
+ _p9k__cache_stat_fprint=$_p9k__cache_val[2]
+ local -a key=($0 $label fprint "$@" "$_p9k__cache_stat_fprint")
+ _p9k__cache_fprint_key="${(pj:\0:)key}"
+ shift 2 _p9k__cache_val
+ return 0
+ else
+ local -a key=($0 $label fprint "$@" "$_p9k__cache_val[2]")
+ _p9k__cache_ephemeral[${(pj:\0:)key}]="${(pj:\0:)_p9k__cache_val[3,-1]}0"
+ fi
fi
if (( $+commands[md5] )); then
@@ -467,7 +472,7 @@ _p9k_cache_stat_get() {
done
local meta_key=$_p9k__cache_key
- if _p9k_cache_get $0 $label fprint "$@" "$_p9k__cache_stat_fprint"; then
+ if _p9k_cache_ephemeral_get $0 $label fprint "$@" "$_p9k__cache_stat_fprint"; then
_p9k__cache_fprint_key=$_p9k__cache_key
_p9k__cache_key=$meta_key
_p9k_cache_set "$_p9k__cache_stat_meta" "$_p9k__cache_stat_fprint" "$_p9k__cache_val[@]"
@@ -483,7 +488,7 @@ _p9k_cache_stat_get() {
_p9k_cache_stat_set() {
_p9k_cache_set "$_p9k__cache_stat_meta" "$_p9k__cache_stat_fprint" "$@"
_p9k__cache_key=$_p9k__cache_fprint_key
- _p9k_cache_set "$@"
+ _p9k_cache_ephemeral_set "$@"
}
# _p9k_param prompt_foo_BAR BACKGROUND red