Fix #65, sourcing the script multiples times should not cause issues anymore
This commit is contained in:
		
							parent
							
								
									f27ef7a279
								
							
						
					
					
						commit
						186d80054a
					
				|  | @ -133,11 +133,11 @@ _zsh_highlight_bind_widgets() | ||||||
| 
 | 
 | ||||||
|   # Override ZLE widgets to make them invoke _zsh_highlight. |   # Override ZLE widgets to make them invoke _zsh_highlight. | ||||||
|   local cur_widget |   local cur_widget | ||||||
|   for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|orig-*|run-help|which-command|beep)}; do |   for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|run-help|which-command|beep)}; do | ||||||
|     case $widgets[$cur_widget] in |     case $widgets[$cur_widget] in | ||||||
| 
 | 
 | ||||||
|       # Already rebound event: do nothing. |       # Already rebound event: do nothing. | ||||||
|       user:$cur_widget);; |       user:$cur_widget|user:_zsh_highlight_widget_*);; | ||||||
| 
 | 
 | ||||||
|       # User defined widget: override and rebind old one with prefix "orig-". |       # User defined widget: override and rebind old one with prefix "orig-". | ||||||
|       user:*) eval "zle -N orig-$cur_widget ${widgets[$cur_widget]#*:}; \ |       user:*) eval "zle -N orig-$cur_widget ${widgets[$cur_widget]#*:}; \ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue