put most of precmd code under !zle

pull/217/head
romkatv 5 years ago
parent 3674e69b43
commit 9c9039253c

@ -3244,6 +3244,7 @@ _p9k_precmd() {
__p9k_new_status=$?
__p9k_new_pipestatus=($pipestatus)
if ! zle; then
if (( $+_p9k_real_zle_rprompt_indent )); then
if [[ -n $_p9k_real_zle_rprompt_indent ]]; then
ZLE_RPROMPT_INDENT=$_p9k_real_zle_rprompt_indent
@ -3273,12 +3274,6 @@ _p9k_precmd() {
_p9k_init
fi
unsetopt localoptions
prompt_opts=(percent subst)
[[ ! -o prompt_sp ]] || prompt_opts+=sp
[[ ! -o prompt_cr ]] || prompt_opts+=cr
setopt nopromptbang prompt{percent,subst}
_p9k_timer_end=EPOCHREALTIME
if (( _p9k_timer_start )); then
typeset -gF P9K_COMMAND_DURATION_SECONDS=$((_p9k_timer_end - _p9k_timer_start))
@ -3287,12 +3282,20 @@ _p9k_precmd() {
fi
_p9k_save_status
powerlevel9k_refresh_prompt_inplace
_p9k_timer_start=0
_p9k_region_active=0
unset _p9k_line_finished
unset _p9k_preexec_cmd
_p9k_timer_start=0
_p9k_region_active=0
fi
unsetopt localoptions
prompt_opts=(percent subst)
[[ ! -o prompt_sp ]] || prompt_opts+=sp
[[ ! -o prompt_cr ]] || prompt_opts+=cr
setopt nopromptbang prompt{percent,subst}
powerlevel9k_refresh_prompt_inplace
}
function _p9k_zle_keymap_select() {

Loading…
Cancel
Save