bug fix: trigger transient prompt on send-break

pull/995/head
Roman Perepelitsa 4 years ago
parent f2bf019758
commit b673e6a7dd

@ -7241,6 +7241,10 @@ function _p9k_on_widget_zle-line-finish() {
_p9k__line_finished='%{%}' _p9k__line_finished='%{%}'
} }
function _p9k_on_widget_send-break() {
_p9k_on_widget_zle-line-finish int
}
# Usage example: _p9k_display_segment 58 _p9k__1rkubecontext hide # Usage example: _p9k_display_segment 58 _p9k__1rkubecontext hide
function _p9k_display_segment() { function _p9k_display_segment() {
[[ $_p9k__display_v[$1] == $3 ]] && return [[ $_p9k__display_v[$1] == $3 ]] && return
@ -7332,6 +7336,14 @@ function _p9k_widget() {
return res return res
} }
function _p9k_widget_send-break() {
(( ! __p9k_enabled )) || [[ $CONTEXT != start ]] || {
_p9k_widget_hook send-break "$@"
}
local f=${widgets[._p9k_orig_send-break]:-}
[[ -z $f ]] || zle ._p9k_orig_send-break -- "$@"
}
typeset -gi __p9k_widgets_wrapped=0 typeset -gi __p9k_widgets_wrapped=0
function _p9k_wrap_widgets() { function _p9k_wrap_widgets() {
@ -7350,6 +7362,7 @@ function _p9k_wrap_widgets() {
visual-line-mode visual-line-mode
deactivate-region deactivate-region
clear-screen clear-screen
send-break
$_POWERLEVEL9K_HOOK_WIDGETS $_POWERLEVEL9K_HOOK_WIDGETS
) )
else else
@ -7366,6 +7379,7 @@ function _p9k_wrap_widgets() {
zle-line-finish zle-line-finish
zle-history-line-set zle-history-line-set
zle-keymap-select zle-keymap-select
send-break
$_POWERLEVEL9K_HOOK_WIDGETS $_POWERLEVEL9K_HOOK_WIDGETS
${${${(f)"$(<$tmp)"}##* }:#(*\"|.*)} ${${${(f)"$(<$tmp)"}##* }:#(*\"|.*)}
) )
@ -7375,7 +7389,9 @@ function _p9k_wrap_widgets() {
fi fi
local widget local widget
for widget in $widget_list; do for widget in $widget_list; do
functions[_p9k_widget_$widget]='_p9k_widget '${(q)widget}' "$@"' if (( ! $+functions[_p9k_widget_$widget] )); then
functions[_p9k_widget_$widget]='_p9k_widget '${(q)widget}' "$@"'
fi
# The leading dot is to work around bugs in zsh-syntax-highlighting. # The leading dot is to work around bugs in zsh-syntax-highlighting.
zle -A $widget ._p9k_orig_$widget zle -A $widget ._p9k_orig_$widget
zle -N $widget _p9k_widget_$widget zle -N $widget _p9k_widget_$widget

Loading…
Cancel
Save