From 27b60ee433aefc631bf38edd40f2af2bcdaac255 Mon Sep 17 00:00:00 2001 From: Stanislav Seletskiy Date: Fri, 22 Apr 2016 10:55:53 +0600 Subject: [PATCH] play well with zsh-autosuggest --- zsh-syntax-highlighting.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 9ff3a7f..5da90d6 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -223,6 +223,12 @@ _zsh_highlight_bind_widgets() # Override ZLE widgets to make them invoke _zsh_highlight. local cur_widget for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|orig-*|run-help|which-command|beep|set-local-history|yank)}; do + + # Most probably that widgets are already bound, but got rebount by another plugin like autosuggest. + if type _zsh_highlight_widget_$cur_widget 2>&1 >/dev/null; then + continue; + fi + case $widgets[$cur_widget] in # Already rebound event: do nothing.