Skip to content

Commit

Permalink
WIP (untested): implement idea from zsh-users#288 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielshahaf committed Jul 27, 2016
1 parent 54b1142 commit 250a214
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions zsh-syntax-highlighting.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,15 @@ _zsh_highlight_bind_widgets()
builtin) eval "_zsh_highlight_widget_${(q)cur_widget}() { _zsh_highlight_call_widget .${(q)cur_widget} -- \"\$@\" }"
zle -N $cur_widget _zsh_highlight_widget_$cur_widget;;

*)
# Incomplete or nonexistent widget: Bind to z-sy-h directly.
'') _zsh_highlight_widget_${cur_widget}() { :; _zsh_highlight }
zle -N $cur_widget _zsh_highlight_widget_$cur_widget;;

if [[ $cur_widget == zle-* ]] && [[ -z $widgets[$cur_widget] ]]; then
_zsh_highlight_widget_${cur_widget}() { :; _zsh_highlight }
zle -N $cur_widget _zsh_highlight_widget_$cur_widget;;
else
# Default: unhandled case.
*) print -r -- >&2 "zsh-syntax-highlighting: unhandled ZLE widget '$cur_widget'" ;;
print -r -- >&2 "zsh-syntax-highlighting: unhandled ZLE widget '$cur_widget'" ;;
fi
esac
done
}
Expand Down

0 comments on commit 250a214

Please sign in to comment.