bug fix: make reset=2 sticky

pull/471/head
romkatv 5 years ago
parent a0535ffcd6
commit 4b62cd7380

@ -121,7 +121,7 @@ function _p9k_worker_receive() {
sysread -i $_p9k__worker_resp_fd 'buf[$#buf+1]' || return sysread -i $_p9k__worker_resp_fd 'buf[$#buf+1]' || return
done done
local -i reset local -i reset max_reset
for resp in ${(ps:\x1e:)${buf//$'\x05'}}; do for resp in ${(ps:\x1e:)${buf//$'\x05'}}; do
local arg=$resp[2,-1] local arg=$resp[2,-1]
case $resp[1] in case $resp[1] in
@ -142,6 +142,7 @@ function _p9k_worker_receive() {
start_time=0 start_time=0
fi fi
() { eval $arg } () { eval $arg }
(( reset > max_reset )) && max_reset=reset
;; ;;
s) s)
[[ -z $_p9k__worker_pid ]] || return [[ -z $_p9k__worker_pid ]] || return
@ -160,12 +161,12 @@ function _p9k_worker_receive() {
esac esac
done done
if (( reset == 2 )); then if (( max_reset == 2 )); then
_p9k_refresh_reason=worker _p9k_refresh_reason=worker
_p9k_set_prompt _p9k_set_prompt
_p9k_refresh_reason='' _p9k_refresh_reason=''
fi fi
(( reset )) && _p9k_reset_prompt (( max_reset )) && _p9k_reset_prompt
return 0 return 0
} always { } always {
(( $? )) && _p9k_worker_stop (( $? )) && _p9k_worker_stop

Loading…
Cancel
Save