From 4ad311ec0a6837b7c83bcfd1a1bf12cceb03f363 Mon Sep 17 00:00:00 2001
From: m0viefreak <m0viefreak.cm@googlemail.com>
Date: Sat, 30 Jul 2016 20:08:12 +0000
Subject: [PATCH] =?UTF-8?q?driver:=20Enable=20highlighting=20during=20isea?=
 =?UTF-8?q?rch=20under=20zsh=E2=89=A55.3.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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
a8fe22d422515a46a4c2e968ff37762c577059bc to be correct.

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

[i257] https://github.com/zsh-users/zsh-syntax-highlighting/pull/257#issuecomment-168394665
---
 zsh-syntax-highlighting.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh
index de3fea9..7879216 100644
--- a/zsh-syntax-highlighting.zsh
+++ b/zsh-syntax-highlighting.zsh
@@ -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