summaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-01-28 13:09:51 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-01-28 13:09:51 +0300
commit5f6d73c5ac6f623c99c2e781d27c6471fa0b22bd (patch)
tree73f886fd3a544a17e708383e9abf861c3dd03c6f /internal/p10k.zsh
parent43fe2c30d17683462f2138f0a5934b7210d8d5b0 (diff)
don't call stat in prompt_dir; use _p9k__parent_mtimes instead
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh13
1 files changed, 4 insertions, 9 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 956e7275..eb786a10 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1764,13 +1764,12 @@ prompt_dir() {
elif [[ $p[1] == / ]]; then
(( ++i ))
fi
- local parent="${_p9k__cwd%/${(pj./.)parts[i,-1]}}"
if (( i <= e )); then
- local MATCH= mtimes=()
- zstat -A mtimes +mtime -- ${(@)${:-{$i..$e}}/(#m)*/$parent/${(pj./.)parts[i,$MATCH]}} 2>/dev/null || mtimes=()
+ local parent="${_p9k__cwd%/${(pj./.)parts[i,-1]}}"
+ local mtimes=(${(Oa)_p9k__parent_mtimes:$(($#parts-e)):$((e-i+1))})
local key="${(pj.:.)mtimes}"
else
- local key='good'
+ local key=
fi
if ! _p9k_cache_ephemeral_get $0 $e $i $_p9k__cwd || [[ $key != $_p9k_cache_val[1] ]] ; then
_p9k_prompt_length $delim
@@ -1837,11 +1836,7 @@ prompt_dir() {
parts[i]+=$'\2'
done
fi
- if [[ -n $key ]]; then
- _p9k_cache_ephemeral_set "$key" "${parts[@]}"
- else
- _p9k_cache_val=("$key" "${parts[@]}")
- fi
+ _p9k_cache_ephemeral_set "$key" "${parts[@]}"
fi
parts=("${(@)_p9k_cache_val[2,-1]}")
;;