1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-29 06:40:08 +00:00

remove artificial term scrolling before instant prompt

This commit is contained in:
Roman Perepelitsa 2020-11-10 09:59:41 +01:00
parent e2db860745
commit 271836403d

View file

@ -7372,10 +7372,11 @@ function _p9k_on_widget_zle-line-finish() {
(( _p9k_reset_on_line_finish )) && __p9k_reset_state=2 (( _p9k_reset_on_line_finish )) && __p9k_reset_state=2
(( $+functions[p10k-on-post-prompt] )) && p10k-on-post-prompt (( $+functions[p10k-on-post-prompt] )) && p10k-on-post-prompt
local -i optimized
if [[ -n $_p9k_transient_prompt ]]; then if [[ -n $_p9k_transient_prompt ]]; then
if [[ $_POWERLEVEL9K_TRANSIENT_PROMPT == always || $_p9k__cwd == $_p9k__last_prompt_pwd ]]; then if [[ $_POWERLEVEL9K_TRANSIENT_PROMPT == always || $_p9k__cwd == $_p9k__last_prompt_pwd ]]; then
RPROMPT= optimized=1
PROMPT=$_p9k_transient_prompt
__p9k_reset_state=2 __p9k_reset_state=2
else else
_p9k__last_prompt_pwd=$_p9k__cwd _p9k__last_prompt_pwd=$_p9k__cwd
@ -7390,11 +7391,11 @@ function _p9k_on_widget_zle-line-finish() {
zle -F $_p9k__restore_prompt_fd _p9k_restore_prompt zle -F $_p9k__restore_prompt_fd _p9k_restore_prompt
fi fi
fi fi
if (( $+termcap[up] )); then if (( optimized )); then
(( _p9k__can_hide_cursor )) && local hide=$terminfo[civis] || local hide= RPROMPT= PROMPT=$_p9k_transient_prompt _p9k_reset_prompt
echo -nE - $hide$'\n'$termcap[up] else
_p9k_reset_prompt
fi fi
_p9k_reset_prompt
fi fi
_p9k__line_finished='%{%}' _p9k__line_finished='%{%}'