add powerlevel9k_refresh_prompt_inplace that users can from zle widgets to refresh prompt inplace

pull/78/head
romkatv 5 years ago
parent a405d8af70
commit e8f2c1aa6f

@ -2196,23 +2196,29 @@ function _p9k_update_prompt() {
typeset -gi _P9K_REGION_ACTIVE
set_default POWERLEVEL9K_PROMPT_ADD_NEWLINE false
powerlevel9k_refresh_prompt_inplace() {
emulate -L zsh
_p9k_init
_P9K_REFRESH_REASON=precmd
_p9k_set_prompt
_P9K_REFRESH_REASON=''
}
powerlevel9k_prepare_prompts() {
# Do not move these lines down, otherwise the last command is not what you expected it to be.
_P9K_EXIT_CODE=$?
_P9K_PIPE_EXIT_CODES=( "$pipestatus[@]" )
_P9K_COMMAND_DURATION=$((EPOCHREALTIME - _P9K_TIMER_START))
_P9K_TIMER_START=1e10
_P9K_REGION_ACTIVE=0
unsetopt local_options
unsetopt localoptions
prompt_opts=(cr percent sp subst)
setopt nopromptbang prompt{cr,percent,sp,subst}
_p9k_init
_P9K_TIMER_START=1e10
_P9K_REGION_ACTIVE=0
_P9K_REFRESH_REASON=precmd
_p9k_set_prompt
_P9K_REFRESH_REASON=''
powerlevel9k_refresh_prompt_inplace
}
function _p9k_zle_keymap_select() {

Loading…
Cancel
Save