[TxMt] Re: TextMate freezes when lines are super long
Allan Odgaard
mailinglist at textmate.org
Sun Dec 8 01:44:56 UTC 2013
On 8 Dec 2013, at 3:30, Walter Lee Davis wrote:
> FWIW, I believe this happens because of the regular expression
> scanning going on to effect syntax highlighting. If you can set this
> particular file type to .txt or another non-highlighted format first,
> you may find that opening it goes faster.
I believe the main issue is text layout. This is pretty expensive and
it’s hard to break up a single line partly due to unicode rules partly
because we need the width of the full line (which requires the full line
to go through layout).
Enabling soft wrap should improve performance significantly since here
we do break up the line (on spaces) and only the stuff that is visible
will actually go through layout, so smaller chunks are given to
CoreText.
It’s a known issue, but how to fix it is challenging, as effectively
we need to pass less to CoreText, and to do that properly we need to
partially replicate unicode rules in TextMate (instead of leaving that
to the system) and also need to estimate glyph widths to have some
estimates to use before we get real values from CoreText.
More information about the textmate
mailing list