Skip to content

Commit

Permalink
driver: Hook zle-line-finish.
Browse files Browse the repository at this point in the history
Compare issue zsh-users#288.
  • Loading branch information
danielshahaf authored and phy1729 committed Oct 21, 2018
1 parent 75e57cc commit 70e3e7e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions zsh-syntax-highlighting.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,20 @@ _zsh_highlight_bind_widgets()
}

if (( $zsh_highlight_use_redrawhook )); then
_zsh_highlight__zle-line-finish() {
# Reset $WIDGET since the 'main' highlighter depends on it.
#
# A nested function is required to hide zle parameters; see
# "User-defined widgets" in zshall.
() {
local -h +r WIDGET=zle-line-finish
_zsh_highlight "$@"
}
}
_zsh_highlight_bind_widgets(){}
if [[ -o zle ]]; then
add-zle-hook-widget zle-line-pre-redraw _zsh_highlight
add-zle-hook-widget zle-line-finish _zsh_highlight__zle-line-finish
fi
fi

Expand Down

0 comments on commit 70e3e7e

Please sign in to comment.