-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
close without saving #1470
Comments
This is a duplicate of #533, so I will close it. But I'll elaborate anyway. The changes are already saved to disk, which is part of the core functionality of novelWriter. It treats your project as individual documents, so each time you edit a document, it is saved. I made a deliberate choice against keeping a project entirely in memory between saves. This is a specifically designed feature, but the disadvantage is that you cannot treat the project as if it was a single document (like in LibreOffice) and choose to not save it. When I add the single project file option, it would be possible to discard changes, as there will be a distinction between the copy you're editing and the copy saved in your storage area (you cannot perform dynamic read/write operations on a zip file). I can possibly add a discard changes option when I implement this. See feature #977. |
Sorry for duplicating the topic. Of course, the decision is up to you. Anyway, let me offer a solution. If you are considering using the .zip format, it would be possible to create a temporary .zip copy of the project every time the user opens it, and use that when selecting Close without saving. And to update this backup copy only when saving manually while working, not when saving automatically. Once the project was closed, the temporary copy would be deleted. |
No problem. I've referenced this request in the single file format implementation so the specifics discussed here can be taken into account still.
So, the thing about zip files is that they are archives. They are sort of multi-read, single-write. I say sort of, because you can append to them. However, you cannot practically use them for repeated writing. The way to work with them as storage for project or large document data (as LibreOffice and I think also MS Office does) is generally to extract them and keep them all in memory. Since I want to preserve the continuous writing feature of novelWriter, which is a safety feature, I will extract the zip file when a project is opened. Then novelWriter will work against the extracted copy, and only create zip archives when the project is either manually saved (Ctrl+Shift+S) or when it is closed. The runtime vs stored location functionality, and the writing of the zip archive is already written into the current version of novelWriter. The former feature is not yet in use, and the latter is only currently used for backups. Now, I haven't decided where to extract the archive. I want to either extract it to a temporary folder somewhere in the user's app directory (this is where novelWriter already stores other user-specific data), or I can extract the zip archive in the same location where the zip file is saved. I.e. If you open In theory, I can also offer this solution for users using the folder based storage, as duplicating a folder isn't practically any different than extracting an archive. However, people who want to stay with the folder based projects will likely do so because they are already using a version control system, so they already have full control of the version history, and can easily just undo the changes they want to get rid of. |
It might help (at least it helps me) to think about this not as "close without saving", but as "revert to previous version", the previous version being the last one saved manually. |
Sometimes I need to close Novelwriter without saving the changes to disk. But the exit dialog allows to just stay in the project or close Novelwriter and save the project. Is it possible to give option to quit Novelwriter without saving?
The text was updated successfully, but these errors were encountered: