The current behavior when a file that is open in TeXStudio is changed externally is less than satisfactory. To illustrate:
Problems:
That's the way eclipse and Visual Studio handle it, that's what I believe is state of the art. If you feel like going beyond the state of the art, consider the following behavior:
The funny thing is: When trying to replicate the behavior, the dialog doesn't show up anymore. The only thing that I have changed to my system is the installation and one-time usage of TeXMaker. Where does TeXStudio store its configuration? -- While the dialog doesn't bother me anymore (by now), the enhanced undo stack remains a valid request.
Anonymous
It's not so easy to update, because TXS maintains internal information on the document (structure, labels etc.). Currently an "update" on external changes works like close-reopen. Therefore the undo/redo stack is lost.
You can have the following cases:
i) no changes at all
ii) changes, but the current version is the same as the one on disk (i.e. either saved or changes undone).
iii) Unsaved changes
i) does not pop up a dialog, because its safe to update in this case. ii) asks the user, because the undo/redo stack is gone after the update, which potentially can lead to a loss of data. For this case we may add an option (default off), to auto-update, knowing the risk of clearing the undo stack.
iii) would require a diff and merge (anyway automatic handling would only be possible if there is no conflict). IMHO that's not so easy. I think it will not come in near future, because there are more important things to work on. The same is true for the enhanced undo stack.
In the case of ii), instead of close-reopen the whole document contents should be replaced in one undoable command. This shouldn't be too difficult, and the internal cache for the document structure should be rebuilt as well. This is akin to copying the contents of one .tex file and pasting it into another already opened .tex file.
The diff-and-merge required for iii) is challenging, yes. But as I mentioned, using the same behavior as for ii) (perhaps with a warning message).
So: Turning off the nag dialog for ii) should be easy, but perhaps you see problems I am unaware of that disallow an easy implementation of the enhanced undo stack.
Unfinished second paragraph in the previous comment: ...using the same behavior as for ii) (perhaps with a warning
message) would be good already, too.
The only difficulty is that for large documents, the file is not loaded completely in one pass, but in chunks which are then added to the document separately
Actually there is already a diff-and-merge (at least in the svn version)
However, the current implementation makes things worse, because now two dialogs are shown: The old dialog, and a "do you want to diff and merge?"-dialog afterwards.
And it doesn't work so well with changes, since it inserts the old and new version in the text.
exactly, two dialog boxes, so annoying and tiring if u constantly modify with another tool (editor).
I still don't see the problem. Does that matter in terms of undo operations? Or in terms of performance?
I'm checking out the SVN code and will be looking into it. What kind of IDE are you using for development?
And the loading happens in QEditor::load, QDocument::load
On 06/13/12 09:16, SourceForge.net wrote:
Yes, the implementation of the two other requests might be secondary. But, I think the first request ( the autoupdate) is really crucial for the end user. The nagging text in Textstudio is also horrible, hard to understand and so annoying. I am now migrating to Texshop because of the lack of automatic update because autoupdate is really crucial for my work flow. I love texstdio and used it for more than 3 years. Please include this feature in the next release.
An option to switch this off (for case ii) from above) has been implemented in SVN rev. 3872 (Configure -> Advanced Editor -> Special Options). A win installer of an 3883 snapshot is available at https://sourceforge.net/projects/texstudio/files/texstudio/TeXstudio%20SVN/.).
Last edit: Tim Hoffmann 2013-04-11
Will test once I have access to the new version. Currently, qmake texstudio.pro gives me the following error (Ubuntu 13.04):