diff --git a/src/app/commands/cmd_save_file.cpp b/src/app/commands/cmd_save_file.cpp index 98778ec94..1545f229d 100644 --- a/src/app/commands/cmd_save_file.cpp +++ b/src/app/commands/cmd_save_file.cpp @@ -185,6 +185,7 @@ protected: { ContextWriter writer(reader); Document* documentWriter = writer.document(); + std::string oldFilename = documentWriter->getFilename(); // Change the document file name documentWriter->setFilename(filename.c_str()); @@ -193,6 +194,9 @@ protected: // Save the document save_document_in_background(documentWriter, markAsSaved); + if (documentWriter->isModified()) + documentWriter->setFilename(oldFilename); + update_screen_for_document(documentWriter); } }