[texworks] Large file issues?
st.loeffler at gmail.com
Thu Apr 7 10:55:46 CEST 2011
On 2011-04-04 21:47, Joseph Wright wrote:
> With large files (1000s of lines), I'm seeing two related issues:
> 1) If the file gets modified externally, TeXworks hangs on trying to
> 2) If I try to alter the highlighting, same thing
> To be able to load the file, I then have to delete it from the recent
> files list (i.e. from the Registry on Windows or the plist on the Mac),
> otherwise I get a hang when I try to open it. I wonder if other people
> are seeing this issue.
I can reproduce these issues. The problem seems to be in the syntax
highlighter, which takes a long time to (re)highlight the whole
document. Ideally, this should probably be done in some kind of
on-demand fashion, but AFAIK this is not implemented in the
QTextDocument class we use ATM.
A few things to note:
* changing the spell checking language also triggers a (complete)
* when loading a file with "!TEX ..." modlines, this can trigger one
(or multiple) rehighlights.
* in the recent files list, settings like spell checking language and
syntax highlighting are also stored; therefore, when opening a file that
has been open recently, one or more additional rehighlights take place.
That said, r784 should alleviate this problem a bit, in that it catches
the situation that a setting is overwritten by the same value and
doesn't trigger a rehighlight in that case (e.g., spell checking is set
to en_US, and the recent files handler "changes" it to en_US, no
rehighlight takes place).
Note, though, that while this should ensure that rehighlighting only
takes place when necessary, it doesn't cut down on the time that takes
by itself. I have experimented with some form of incremental update, but
it seems prone to some hard-to-track errors (e.g., rehighlighting is
scheduled for a paragraph, but that is deleted in the meantime). So, I
guess this won't be solved completely until we do a complete overhaul of
the editor. So, maybe it would be a good idea to open a bug report for
this on GC.
More information about the texworks