aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-10-20 11:36:41 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-10-20 11:36:41 +0300
commitd17f22e5b0f803c7b95eb379be0a810552a3a30a (patch)
tree2046f114f4cf8082d80841227e261e931eca4cf9 /internal/p10k.zsh
parentcb2473751e1b2ec8c02721f8ad5911968b05c647 (diff)
better handling of XDG_CACHE_HOME changes
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh13
1 files changed, 9 insertions, 4 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index a24910b4..69846a53 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -3577,6 +3577,10 @@ _p9k_dump_instant_prompt() {
exec {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 1>$__p9k_instant_prompt_output
exec 2>&1
typeset -gi __p9k_instant_prompt_active=1
+ typeset -g __p9k_instant_prompt_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
+ if source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
+ _p9k_preinit
+ fi
function _p9k_instant_prompt_precmd_first() {
emulate -L zsh
function _p9k_instant_prompt_sched_last() {
@@ -3600,10 +3604,7 @@ _p9k_dump_instant_prompt() {
precmd_functions=(${(@)precmd_functions:#_p9k_instant_prompt_precmd_first})
}
precmd_functions=(_p9k_instant_prompt_precmd_first $precmd_functions)
- typeset -g __p9k_instant_prompt_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
- if source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
- _p9k_preinit
- fi
+
} && unsetopt prompt_cr prompt_sp || true'
} always {
exec {fd}>&-
@@ -5346,5 +5347,9 @@ zmodload -F zsh/stat b:zstat
zmodload -F zsh/net/socket b:zsocket
zmodload -F zsh/files b:zf_mv b:zf_rm
+if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_prompt_dump_file ]]; then
+ zf_rm -f $__p9k_instant_prompt_dump_file 2>/dev/null
+fi
+
_p9k_init_ssh
prompt_powerlevel9k_setup