From 4ff08dcfa6e1adee1946577e9c53d0bd6dbd6024 Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Tue, 26 Jul 2011 23:16:52 +0200 Subject: [PATCH] Fix #53: Prefix all defined functions with _zsh_highlight --- zsh-syntax-highlighting.zsh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 2528f46868..3b7b5b1098 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -144,17 +144,17 @@ for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|orig-*|run-help|which-comman # User defined widget: override and rebind old one with prefix "orig-". user:*) eval "zle -N orig-$cur_widget ${widgets[$cur_widget]#*:}; \ - $cur_widget() { builtin zle orig-$cur_widget && _zsh_highlight }; \ - zle -N $cur_widget";; + _zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget && _zsh_highlight }; \ + zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; # Completion widget: override and rebind old one with prefix "orig-". completion:*) eval "zle -C orig-$cur_widget ${${widgets[$cur_widget]#*:}/:/ }; \ - $cur_widget() { builtin zle orig-$cur_widget && _zsh_highlight }; \ - zle -N $cur_widget";; + _zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget && _zsh_highlight }; \ + zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; # Builtin widget: override and make it call the builtin ".widget". - builtin) eval "$cur_widget() { builtin zle .$cur_widget && _zsh_highlight }; \ - zle -N $cur_widget";; + builtin) eval "_zsh_highlight_widget_$cur_widget() { builtin zle .$cur_widget && _zsh_highlight }; \ + zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; # Default: unhandled case. *) echo "zsh-syntax-highlighting: unhandled ZLE widget '$cur_widget'" >&2 ;;