mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-11 22:02:31 +01:00
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:
parent
38c3ac8831
commit
fb418b90d3
3 changed files with 15 additions and 8 deletions
|
|
@ -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]")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue