

Yes the syntax highlighting appears all the way to the end. The situation has not changed over the last 20 minutes or so. For example, it doesn't happen while I am writing these comments in Safari. The sluggish behavior is limited to the TeXworks editor. TeXworks is essentially using 0% CPU and 60MB memory.
#Texworks command ignore several paragraph mac#
In my Mac Activity Monitor, I see about 30% CPU load and less than 9GB out of 16GB physical memory used. I downloaded a random moderately large TeX file from arXiv (e.g., this 79-page paper, you can just click on "other formats" and select "source") and I got sluggish response when I jumped to the middle of the file and started typing. You might need a “real” document with plenty of symbols and equations and multiple environments to trigger the issue.

Perhaps for a file with just thousands of lines of "lorem ipsum", the variety of LaTeX syntax isn’t rich enough to cause problem. Does it have any influence whether you are editing at the beginning or at the end of the document? Is TeXworks more/less responsive when editing on either side?.When you scroll to the end, when does highlighting appear there?.after a few seconds to a minute without editing? Does the situation (responsiveness and/or system load) change over time, e.g.What is the system load when opening your big file?.After that, everything is "back to normal". During that time, the UI is a bit less responsive, but editing is still possible. On my system, this works fairly well, with a thousand lines of "lorem ipsum" being spell-checked in about a second or so (though this depends on the hardware, system load, etc. Also, in order to not freeze the UI completely, highlighting is done in chunks, which should ideally last only a couple of milliseconds before breaking for a little while to let the UI process user interaction, updates, etc. After the initial highlighting is done, only the part of the document that actually is affected by a change should be rehighlighted (e.g., the line you edit, plus, potentially, subsequent lines if the abovementioned state changed for some reason).
#Texworks command ignore several paragraph code#
That said, the code tries to be smart about it. Hence, syntax highlighting has to be performed at least once for the entire document to properly set up this state information. everything between \begin on each line, a sort of state (e.g., "are we inside a comment") is maintained for each line. Think of highlighting of environments (which is not implemented yet, but is definitely on the wishlist), e.g. The reason is that the syntax highlighting for line x could depend on the state of line x-1. Syntax highlighting generally has to be done (at least once) for the entire document from top to bottom. Unfortunately, "fixing this" may not be that easy.
