Skip to content

Commit

Permalink
driver: Enable highlighting during isearch under zsh≥5.3.
Browse files Browse the repository at this point in the history
This patch causes a behaviour difference in the [i257] scenario:

- Before this change, the zle_highlight[isearch] is applied and z-sy-h's
  highlighting isn't.

- With this change, both zle_highlight[isearch] and z-sy-h's
  highlighting are applied, so «echo foo» renders the first word in green
  underline (fg=green from ZSH_HIGHLIGHT_STYLES[builtin], underline from
  zle_highlight[isearch]).

This patch causes the presuppositional FAQ entry added in
a8fe22d to be correct.

This is part of #261, of which #288 was a spin-off.

[i257] #257 (comment)
  • Loading branch information
m0vie authored and danielshahaf committed Jul 30, 2016
1 parent 171a4ee commit 4ad311e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zsh-syntax-highlighting.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ _zsh_highlight()

# Remove all highlighting in isearch, so that only the underlining done by zsh itself remains.
# For details see FAQ entry 'Why does syntax highlighting not work while searching history?'.
if [[ $WIDGET == zle-isearch-update ]]; then
if [[ $WIDGET == zle-isearch-update ]] && ! (( $+ISEARCHMATCH_ACTIVE )); then
region_highlight=()
return $ret
fi
Expand Down

0 comments on commit 4ad311e

Please sign in to comment.