Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bb3f680
fix: avoid model rollback on document close by tracking session edits
dafi Sep 7, 2026
42fcc12
fix: open the double-clicked history entry, not the stale paths
dafi Sep 7, 2026
a2c9cb8
fix(file-compare): ask to save dirty files before replacing them
dafi Sep 7, 2026
8b4ac46
refactor: share the console pane between the file and the folder window
dafi Sep 12, 2026
4071dfd
refactor: share the comparison status bar between the file and the fo…
dafi Sep 12, 2026
4c918d2
fix(folder-compare): hide the context menu items while a comparison runs
dafi Sep 12, 2026
b30a1c2
perf(file-compare): build the line detail view on TextKit 1
dafi Sep 12, 2026
0714d7f
fix(file-compare): keep the EOL label away from the panel edge
dafi Sep 12, 2026
f7e8542
perf(file-compare): compute the widest column once per comparison
dafi Sep 12, 2026
2a533fc
perf(file-compare): skip the second walk over the common prefix
dafi Sep 12, 2026
ea3a08d
fix(file-compare): reload the row heights only when the column width …
dafi Sep 12, 2026
3277c16
fix: flush the pending changes before reading isDocumentEdited
dafi Sep 12, 2026
3ce4eed
fix(file-compare): ask before the session options drop unsaved edits
dafi Sep 12, 2026
ddc9790
feat(file-compare): run the comparison detached from the main thread
dafi Sep 12, 2026
6307091
chore: suppress XCode warnings relative to future modifications
dafi Sep 13, 2026
535cdb3
refactor: pin the details stack views instead of seeding its frame
dafi Sep 13, 2026
c0f89a2
feat: customize document window keyboard navigation
dafi Sep 14, 2026
fc6224c
fix: handle the negated value correctly
dafi Sep 14, 2026
5401c1b
fix: resolve race condition occurring when ask to stop long running o…
dafi Sep 14, 2026
53a6b7c
refactor: move to folder feature because depends from CommonPrefs
dafi Sep 15, 2026
d3f9072
fix: make operation state thread-safe
dafi Sep 15, 2026
bb75d55
fix: fix race condition when comparing folders
dafi Sep 18, 2026
baf0488
refactor: use always the workspace version to create installation zip
dafi Sep 18, 2026
5274898
fix: handle scriptable errors
dafi Sep 18, 2026
d5d6d66
refactor: modernize xcode project
dafi Sep 25, 2026
8153412
refactor: remove custom component in flavor of auto-layout
dafi Sep 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: flush the pending changes before reading isDocumentEdited
  • Loading branch information
dafi committed Sep 12, 2026
commit 3277c160bb515233d21d7e2f9d7cd333585be035
9 changes: 4 additions & 5 deletions Sources/Core/Document/VDDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ public class VDDocument: NSPersistentDocument {
}
isClosed = true

// the change notification is posted only when the context processes its pending changes,
// so flush them or a change made during this same event is not counted yet
managedObjectContext?.processPendingChanges()

// TODO: update only if document is edited but do not call self.isDocumentEdited because is overridden
if super.isDocumentEdited {
HistorySessionManager.shared.update(document: self, closeDocument: true)
Expand Down Expand Up @@ -266,11 +270,6 @@ public class VDDocument: NSPersistentDocument {
}

override public var isDocumentEdited: Bool {
// the change notification is posted only when the context processes its pending changes,
// so flush them or a change made during this same event is not counted yet
// it must run before the pref check because close() reads super.isDocumentEdited to update the history
managedObjectContext?.processPendingChanges()

// If pref is set to true then consider the document without modifications so the save dialog will never shown
if CommonPrefs.shared.bool(forKey: .dontAskSave) {
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ extension FilesWindowController: @preconcurrency DocumentWindowControllerDelegat

leftView.isDirty = false
rightView.isDirty = false

// the change notification is posted only when the context processes its
// pending changes, the answer below must not miss an edit of this event
document.managedObjectContext?.processPendingChanges()

if document.isDocumentEdited {
leftView.isDirty = tmpLeftDirty
rightView.isDirty = tmpRightDirty
Expand Down