Zsh Mailing List Archive
Messages sorted by:
Re: How can Zle -U interfere with zsh-syntax-highlighting?
- X-seq: zsh-workers 38494
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: How can Zle -U interfere with zsh-syntax-highlighting?
- Date: Sun, 15 May 2016 04:13:21 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=p3tdFZrzR75+boCOtqLkDtgGjH0lquc4bqMrXf8PbOQ=; b=C/jjUcOiA3Wlk6WihxJxrrO3pHPpF0VtlH2W/XxLGdaT0qui8/S52+NHlA9hPqxtSw YNmZmRxU+svxEKP+gE0QwV0XB5nUsU7Dwv1GR3+Q1GzVnK99LOQxhkLKeY+asCoXwjJH BdIn7v71xvIJVO2kZdM325KxPWBdP8ehCgDRQ8axMpMpSdS4QROhlODI1eMwj71hrolC vMziKEJUHZVEybT4Cp1Ud+XENIJAoAa+6v2hvXrIkQHMRa0ksh9JkElhjPf9ZHoTZWAW /heXtAuawooIbrvVg5IRb2IRy+t9ir4Lzk9bLR3JtpRwqmYGNtIKvacsCnYxB0AKPBip 7QjA==
- In-reply-to: <CAKc7PVCZhyjPqzgPSrKOUs=+Qp5m_yELs2uEAwuCQYZXDKkxUg@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCZhyjPqzgPSrKOUs=+Qp5m_yELs2uEAwuCQYZXDKkxUg@mail.gmail.com>
On Sat, May 14, 2016 at 2:07 PM, Sebastian Gniazdowski
> Below is a widget that outputs long sophisticated string with zle -U:
> With z-sy-h enabled, it takes 4 seconds to appear after pressing
> Ctrl-T. Pasting the same text is instant and correct (i.e.
> highlighting works). What can be happening?
This (line 73-74 in current z-sy-h.zsh):
# Do not highlight if there are pending inputs (copy/paste).
[[ $PENDING -gt 0 ]] && return $ret
"zle -U" feeds the input back to zle one character at a time but does
not set PENDING, so I suspect the highlight is being recaculated after
every character. 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.
This also explains why immediately typing something else speeds things
up: Highlighting pauses until that character is consumed.
> Is there some alternative to Zle -U?
Other than just LBUFFER+="long text here", no. If you want the other
effects of zle -U (i.e., that each character is interpreted as if it
had been typed) then there is no alternative.
Messages sorted by: