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

Re: Slow highlighting (Re: "drop-in replacement" and transpose-words-match)

On Wed, Jan 27, 2016 at 5:31 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jan 26, 10:50pm, Daniel Shahaf wrote:
> } Subject: Re: Slow highlighting (Re: "drop-in replacement" and transpose-wo
> }
> } fned with z-sy-h is slow.
> }
> } vared with z-sy-h is slow.
> }
> } > What about with a history line containing a function definition?
> }
> } Also slow.
> }
> } I also tested it as a single line, and that was still slow:
> So, it's not "zed", it's any case where you're doing syntax analysis of
> a function definition.
> Time to start eliminating the set of highlighters one by one until you
> find one that seems to be the culprit?  Glancing at the github pages,
> there seem to be several hightlighters on by default.  My bet would be
> on the one that looks for balanced braces, because there is always an
> unmatched open brace lurking at the start of the function.
> Of course it a combination of highlighters may be involved, which would
> be more difficult to isolate.

If it is the brace matching code, does it use shell code to loop over
the buffer, or use the zle widget (vi-match-bracket / match-bracket (i
don't think i've committed the latter, the former is a bit finicky to
use but it is possible)? I found using shell code is way too slow on
anything over a couple hundred characters, whereas the widget is fast
enough for anything i've thrown at it. I just tried zed -f
zsh_directory_name which is 200 lines long, and everything works fine
here with my highlighting code (i don't use z-sy-h).

Mikael Magnusson

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