File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -235,8 +235,10 @@ _zsh_highlight_bind_widgets()
235
235
}
236
236
237
237
# Override ZLE widgets to make them invoke _zsh_highlight.
238
+ local -U widgets_to_bind
239
+ widgets_to_bind=(${${(f)" $( builtin zle -la) " } :# (.* |orig-* |run-help|which-command|beep|set-local-history|yank)} )
238
240
local cur_widget
239
- for cur_widget in ${ ${(f) " $( builtin zle -la ) " } :# (. * |orig- * |run-help|which-command|beep|set-local-history|yank)} ; do
241
+ for cur_widget in $widgets_to_bind ; do
240
242
case $widgets [$cur_widget ] in
241
243
242
244
# Already rebound event: do nothing.
@@ -262,6 +264,10 @@ _zsh_highlight_bind_widgets()
262
264
builtin) eval " _zsh_highlight_widget_${(q)cur_widget} () { _zsh_highlight_call_widget .${(q)cur_widget} -- \"\$ @\" }"
263
265
zle -N $cur_widget _zsh_highlight_widget_$cur_widget ;;
264
266
267
+ # Special zle-* hook that is currently not bound at all: Bind to z-sy-h driectly.
268
+ ' ' ) eval " _zsh_highlight_widget_${(q)cur_widget} () { :; _zsh_highlight }"
269
+ zle -N $cur_widget _zsh_highlight_widget_$cur_widget ;;
270
+
265
271
# Default: unhandled case.
266
272
* ) echo " zsh-syntax-highlighting: unhandled ZLE widget '$cur_widget '" >&2 ;;
267
273
esac
You can’t perform that action at this time.
0 commit comments