work around bugs in add-zle-hook-widget (#1238)

pull/1241/head
Roman Perepelitsa 4 years ago
parent d26bdcd601
commit b816abfed0

@ -7584,9 +7584,15 @@ function _p9k_wrap_widgets() {
if (( ! $+functions[_p9k_widget_$widget] )); then if (( ! $+functions[_p9k_widget_$widget] )); then
functions[_p9k_widget_$widget]='_p9k_widget '${(q)widget}' "$@"' functions[_p9k_widget_$widget]='_p9k_widget '${(q)widget}' "$@"'
fi fi
if [[ $widget == zle-* &&
$widgets[$widget] == user:azhw:* &&
$functions[add-zle-hook-widget] ]]; then
add-zle-hook-widget $widget _p9k_widget_$widget
else
# 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
fi
done 2>/dev/null # `zle -A` fails for inexisting widgets and complains to stderr done 2>/dev/null # `zle -A` fails for inexisting widgets and complains to stderr
} }

Loading…
Cancel
Save