You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual Result
The template content overwrites the open document's content. If the user saves the document, they will lose the original content.
Expected Result
When a template is opened, the user should be asked if they would like to save the current document (this is addressed in Issue #100) and a new .tex document should open.
The text was updated successfully, but these errors were encountered:
I figured it out:
-when you open a new file, program calls method setCurrentFile from EditorTopComponent,
-it allows program to store info about which file is currently opened,
-but, for now template is being loaded with this code: etc.setEditorContent(FileService.readFromStream(getClass().getResourceAsStream(templatesList.getSelectedValue().getPath())));
-it just changes text in editor area,
-so, EditorTopComponent still have currentFile set to file that has been opened before,
-so, when you try to save file, it gets file path from EditorTopComponent from currentFile variable and overrides your file.
I hope, that it's understandable. :)
I fixed it, but couldn't (or don't know how) open another pull request without changes in Issue #100, so I just committed them to my currently opened pull request. Sorry for messing up.
Steps to Reproduce
Actual Result
The template content overwrites the open document's content. If the user saves the document, they will lose the original content.
Expected Result
When a template is opened, the user should be asked if they would like to save the current document (this is addressed in Issue #100) and a new .tex document should open.
The text was updated successfully, but these errors were encountered: