better handling of XDG_CACHE_HOME changes

pull/275/head
romkatv 5 years ago
parent cb2473751e
commit d17f22e5b0

@ -3577,6 +3577,10 @@ _p9k_dump_instant_prompt() {
exec {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 1>$__p9k_instant_prompt_output exec {__p9k_fd_1}>&1 {__p9k_fd_2}>&2 1>$__p9k_instant_prompt_output
exec 2>&1 exec 2>&1
typeset -gi __p9k_instant_prompt_active=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() { function _p9k_instant_prompt_precmd_first() {
emulate -L zsh emulate -L zsh
function _p9k_instant_prompt_sched_last() { 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=(${(@)precmd_functions:#_p9k_instant_prompt_precmd_first})
} }
precmd_functions=(_p9k_instant_prompt_precmd_first $precmd_functions) 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' } && unsetopt prompt_cr prompt_sp || true'
} always { } always {
exec {fd}>&- exec {fd}>&-
@ -5346,5 +5347,9 @@ zmodload -F zsh/stat b:zstat
zmodload -F zsh/net/socket b:zsocket zmodload -F zsh/net/socket b:zsocket
zmodload -F zsh/files b:zf_mv b:zf_rm 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 _p9k_init_ssh
prompt_powerlevel9k_setup prompt_powerlevel9k_setup

@ -27,7 +27,7 @@
return return
fi fi
typeset -gr __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh typeset -gr __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
_p9k_preinit _p9k_preinit
fi fi
typeset -gr __p9k_sourced=1 typeset -gr __p9k_sourced=1

Loading…
Cancel
Save