mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-01-30 09:47:13 +08:00
Issue 26: The script unplugs user defined events
This commit is contained in:
parent
701cc303fe
commit
0e55450a0b
@ -213,20 +213,22 @@ _zsh_highlight-zle-buffer() {
|
|||||||
# reason). You can see the default setup using "zle -l -L".
|
# reason). You can see the default setup using "zle -l -L".
|
||||||
|
|
||||||
# Bind all ZLE events from zle -la to highlighting function.
|
# Bind all ZLE events from zle -la to highlighting function.
|
||||||
|
local clean_event_name
|
||||||
for f in $(zle -la); do
|
for f in $(zle -la); do
|
||||||
case $f in
|
case $f in
|
||||||
.*|_*)
|
_*)
|
||||||
;;
|
;;
|
||||||
accept-and-menu-complete)
|
accept-and-menu-complete)
|
||||||
eval "$f() { builtin zle .$f && _zsh_highlight-zle-buffer } ; zle -N $f"
|
eval "$f() { builtin zle .$f && _zsh_highlight-zle-buffer } ; zle -N $f"
|
||||||
;;
|
;;
|
||||||
*complete*)
|
[^\.]*complete*)
|
||||||
eval "zle -C orig-$f .$f _main_complete ; $f() { builtin zle orig-$f && _zsh_highlight-zle-buffer } ; zle -N $f"
|
eval "zle -C orig-$f .$f _main_complete ; $f() { builtin zle orig-$f && _zsh_highlight-zle-buffer } ; zle -N $f"
|
||||||
;;
|
;;
|
||||||
|
.*)
|
||||||
|
local clean_event_name=$f[2,${#f}] # Remove the leading dot in the event name
|
||||||
|
eval "$clean_event_name() { builtin zle $f && _zsh_highlight-zle-buffer } ; zle -N $clean_event_name"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
eval "$f() { builtin zle .$f && _zsh_highlight-zle-buffer } ; zle -N $f"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user