From 0e55450a0bdcb7a23ec2cc0cf6a7ab7614d8ee07 Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Wed, 5 Jan 2011 22:11:00 +0100 Subject: [PATCH] Issue 26: The script unplugs user defined events --- zsh-syntax-highlighting.zsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 6001f4b..993bc04 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -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 - -