mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-26 05:50:07 +00:00
work around bugs in zsh-syntax-highlighting
This commit is contained in:
parent
1173119d55
commit
ed78375a2e
1 changed files with 3 additions and 2 deletions
|
@ -5327,7 +5327,7 @@ function _p9k_widget_hook() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _p9k_widget() {
|
function _p9k_widget() {
|
||||||
(( ! ${+widgets[_p9k_orig_$1]} )) || zle _p9k_orig_$1 "${@:2}"
|
(( ! ${+widgets[._p9k_orig_$1]} )) || zle ._p9k_orig_$1 "${@:2}"
|
||||||
local res=$?
|
local res=$?
|
||||||
(( ! __p9k_enabled )) || _p9k_widget_hook "$@"
|
(( ! __p9k_enabled )) || _p9k_widget_hook "$@"
|
||||||
return res
|
return res
|
||||||
|
@ -5348,7 +5348,8 @@ function _p9k_wrap_widgets() {
|
||||||
local widget
|
local widget
|
||||||
for widget in ${(u)${${(f)"$(<$tmp)"}##* }:#(*\"|.*)}; do
|
for widget in ${(u)${${(f)"$(<$tmp)"}##* }:#(*\"|.*)}; do
|
||||||
functions[_p9k_widget_$widget]='_p9k_widget '${(q)widget}' "$@"'
|
functions[_p9k_widget_$widget]='_p9k_widget '${(q)widget}' "$@"'
|
||||||
zle -A $widget _p9k_orig_$widget
|
# The leading dot is to work around bugs in zsh-syntax-highlighting.
|
||||||
|
zle -A $widget ._p9k_orig_$widget
|
||||||
zle -N $widget _p9k_widget_$widget
|
zle -N $widget _p9k_widget_$widget
|
||||||
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
|
||||||
} always {
|
} always {
|
||||||
|
|
Loading…
Reference in a new issue