cursor: Remove cursor highlighting when accepting a line.

Fixes zsh-users/zsh-syntax-highlighting#109.

Similar to 59fbdda64c in the 'main' highlighter.
This commit is contained in:
Daniel Shahaf 2015-11-17 00:05:06 +00:00
parent 96ee5116b1
commit 4f0c293fde

View file

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