Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How can Zle -U interfere with zsh-syntax-highlighting?



On 15 May 2016 at 13:13, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> 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.

Forgot about LBUFFER, thanks! I have two tools, and it is interesting
that in one (n-history) doing LBUFFER+="$var_with_long_text" causes
highlighting to correctly work (and also solves the lag issue) whie in
other tool (n-kill) it doesn't trigger highlighting. I made the two
responsible code blocks identical (I do zle redisplay and zle
kill-buffer before zle -U / LBUFFER+=), even hardcoded the text:

LBUFFER+='a=; a=${(r:100000::_:)a}...'

and it still behaves this way. Both tools use emulate -L zsh, also
tried emulate -LR zsh. Luckily, I need LBUFFER+= only in the one tool
that works.

Best regards,
Sebastian Gniazdowski



Messages sorted by: Reverse Date, Date, Thread, Author