treat zle-isearch-exit like an accept-* widget

Accepting a line in an iserch does not call through any of the
accept-widgets. To be able to still do some cleanup (remove
cursor imprint, remove partial path highlinting) use
zle-isearch-exit instead.
This commit is contained in:
m0viefreak 2015-12-29 20:04:52 +01:00
commit fb418b90d3
3 changed files with 15 additions and 8 deletions

View file

@ -34,15 +34,14 @@
# Whether the cursor highlighter should be called or not.
_zsh_highlight_cursor_highlighter_predicate()
{
# accept-* may trigger removal of cursor highlighting
[[ $WIDGET == accept-* ]] ||
_zsh_highlight_cursor_moved
# widgets which accept lines may trigger removal of cursor highlighting
_zsh_highlight_cursor_moved || _zsh_highlight_is_accept_line_type_widget
}
# Cursor highlighting function.
_zsh_highlight_cursor_highlighter()
{
[[ $WIDGET == accept-* ]] && return
_zsh_highlight_is_accept_line_type_widget && return
region_highlight+=("$CURSOR $(( $CURSOR + 1 )) $ZSH_HIGHLIGHT_STYLES[cursor]")
}