From d8ffc1b128857004816612a78ab72ebf478fef49 Mon Sep 17 00:00:00 2001 From: Gnohz Gniy <0x00eeee@gmail.com> Date: Tue, 29 Oct 2024 22:49:31 +0800 Subject: [PATCH] Prevent file save without changes (#735) --- MarkEditMac/Sources/Editor/Models/EditorDocument.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MarkEditMac/Sources/Editor/Models/EditorDocument.swift b/MarkEditMac/Sources/Editor/Models/EditorDocument.swift index b7e34e02..bda6f1cf 100644 --- a/MarkEditMac/Sources/Editor/Models/EditorDocument.swift +++ b/MarkEditMac/Sources/Editor/Models/EditorDocument.swift @@ -403,8 +403,8 @@ private extension EditorDocument { return // Cancelled } - if document.hasBeenReverted { - // Reverted + if document.hasBeenReverted || !document.isDocumentEdited { + // Reverted or no unsaved changes document.close() } else { // Saved