Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
Date: Thu, 19 May 2016 21:22:18 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: How can Zle -U interfere with zsh-syntax-highlighting?
Message-ID: <20160519212218.GA3125@tarsus.local2>
References: <CAKc7PVCZhyjPqzgPSrKOUs=+Qp5m_yELs2uEAwuCQYZXDKkxUg@mail.gmail.com>
 <CAH+w=7b7g-g7JmFvrgR4ezWz7CrVZnXVrV+u9iOitX0H0y_pVQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <CAH+w=7b7g-g7JmFvrgR4ezWz7CrVZnXVrV+u9iOitX0H0y_pVQ@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 38522

Bart Schaefer wrote on Sun, May 15, 2016 at 04:13:21 -0700:
> I suppose it might make sense for "zle -U" to pretend to be actual
> input even to the extent of PENDING, but it currently does not.

Like this?

[[[
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index c6387bf..d5b1e87 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -500,7 +500,7 @@ get_bufferlines(UNUSED(Param pm))
 static zlong
 get_pending(UNUSED(Param pm))
 {
-    return noquery(0);
+    return noquery(0) + kungetct;
 }
 
 /**/
]]]

It doesn't cause any obvious problem, but I couldn't reproduce the
original slowdown so I'm not sure whether this patch fixes it.

In any case, I won't push it yet since I won't be able to commit
followups timely in case it breaks something — but if someone else wants
to push it before I get back, feel free.

Cheers,

Daniel

