Issue 26: The script unplugs user defined events

This commit is contained in:
Julien Nicoulaud 2011-01-05 22:11:00 +01:00
parent 701cc303fe
commit 0e55450a0b
1 changed files with 7 additions and 5 deletions

View File

@ -213,20 +213,22 @@ _zsh_highlight-zle-buffer() {
# reason). You can see the default setup using "zle -l -L".
# Bind all ZLE events from zle -la to highlighting function.
local clean_event_name
for f in $(zle -la); do
case $f in
.*|_*)
_*)
;;
accept-and-menu-complete)
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"
;;
.*)
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
done