Skip to content

Commit d92b5d9

Browse files
authored
Fix Edited Indicator Behavior (#1910)
* - The edited indicator now behaves as expected - The autosave() method provided by NSDocument automatically calls updateChangeCount accordingly, as such, removing the direct call to updateChangeCount with a value of .changeCleared resolves the issue
1 parent 8fe1b28 commit d92b5d9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

CodeEdit/Features/Editor/Views/CodeFileView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ struct CodeFileView: View {
8080
.textUpdatePublisher
8181
.debounce(for: 1.0, scheduler: DispatchQueue.main)
8282
.sink { _ in
83+
// updateChangeCount is automatically managed by autosave(), so no manual call is necessary
8384
codeFile.autosave(withImplicitCancellability: false) { error in
8485
if let error {
8586
CodeFileDocument.logger.error("Failed to autosave document, error: \(error)")
86-
} else {
87-
codeFile.updateChangeCount(.changeCleared)
8887
}
8988
}
9089
}

0 commit comments

Comments
 (0)