driver: Always bind zle-line-finish and use it instead of accept-*

Special handling for cursor imprint or partial path highlighting
is needed in more cases than accept-*. For example when accepting
a line from isearch, no accept-* widget is invoked.

The proper way is to use zle-line-finish.

Trumps #259.
Fixes #284.
This commit is contained in:
m0viefreak
2016-03-29 21:56:57 +02:00
committed by Daniel Shahaf
parent 9e569bb0fe
commit 5bae621900
4 changed files with 13 additions and 9 deletions

View File

@@ -252,6 +252,12 @@ _zsh_highlight_bind_widgets()
# Override ZLE widgets to make them invoke _zsh_highlight.
local -U widgets_to_bind
widgets_to_bind=(${${(k)widgets}:#(.*|orig-*|run-help|which-command|beep|set-local-history|yank)})
# Always wrap special zle-line-finish widget. This is needed to decide if the
# current line ends and special highlighting logic needs to be applied.
# E.g. remove cursor imprint, don't highlight partial paths, ...
widgets_to_bind+=(zle-line-finish)
local cur_widget
for cur_widget in $widgets_to_bind; do
case $widgets[$cur_widget] in