Menu

#764 Close previously open viewer document on Save As

None
closed
nobody
2
2014-10-30
2014-09-11
crumbedfish
No

Summary:

The current behaviour for closing a source document in the editor, is that it's corresponding document in the viewer is also closed. This (i.e. closing the document being displayed in the viewer) should also happen when a document goes out of scope as a result of being saved as a document with a new name.

A scenario that has happened with me a few times is that I save a document with a new name, and edit the new document without compiling or viewing it. If I need to go away and come back later (sometimes after many hours), I may forget that the viewer is still displaying the old document's pdf (since they are almost identical), and if I decide to view the source using "Go to source" at some position in the viewer (which is still displaying the old pdf document), then TXS opens up the old document and goes to the appropriate position. This happens smoothly enough that I don't realise and start editing the old document and only later realise I now have changes across two documents and have to consolidate the changes.

Granted I should remember to close the viewer and recompile the new document, but I believe that this is a usability issue and should and can be corrected by closing the displayed document in the view when a document is successfully saved as another document. This would make the behaviour consistent with the explicit closing of a document.

To reproduce:

  1. Open and save a document with the name "test1.tex".

  2. Compile and view "test1.tex". Ensure that the generated pdf is showing in the viewer.

  3. Save "test1.tex" as "test2.tex" using File->Save As. Note that "test1.tex" has been closed and the editor is now displaying "test2.tex".

  4. Make some edits to "test2.tex". DO NOT compile or view.

  5. Go to the viewer and right-click somewhere in the pdf to choose "Go to source".

  6. "test1.tex" is opened in the source window at the appropriate position. Due to the fact that the two documents are mostly the same in this case, it feels like you are editing the the newer document (especially if you have been away from your desk for a while), and may start editing "test1.tex", unless you notice it. However, this may not always happen (i.e. that you notice what is open), because it isn't something one always does when editing. You may end up editing the older file and end up with different edits in different documents.

Related

Feature Requests: #1111

Discussion

  • crumbedfish

    crumbedfish - 2014-10-28

    Hello,

    Just a quick note to say that I've just done this to myself again. I have two documents open with edits in both of them, which I will now need to consolidate. Either I'm not using TS in the way that it should be or it is a valid problem. I'm sure there must be others who have come across this problem as well...?

    thanks.

     

    Last edit: crumbedfish 2014-10-28
  • Tim Hoffmann

    Tim Hoffmann - 2014-10-29

    We now show a message in the viewer if the the source has been renamed by a Save As operation. Closing would be too harsh because someone might still want the old pdf. But with the message you clearly see that the pdf does not belong to the source anymore.

    hg 4778 (7507ed395aa7)

     

    Last edit: Tim Hoffmann 2014-10-29
  • Tim Hoffmann

    Tim Hoffmann - 2014-10-29
    • status: open --> closed
    • Group: -->
     
  • crumbedfish

    crumbedfish - 2014-10-29

    Great, thank you!

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB