Skip to content

Commit

Permalink
Fix Edited Indicator Behavior (#1910)
Browse files Browse the repository at this point in the history
* - 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
  • Loading branch information
Kihron authored Oct 19, 2024
1 parent 8fe1b28 commit d92b5d9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CodeEdit/Features/Editor/Views/CodeFileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ struct CodeFileView: View {
.textUpdatePublisher
.debounce(for: 1.0, scheduler: DispatchQueue.main)
.sink { _ in
// updateChangeCount is automatically managed by autosave(), so no manual call is necessary
codeFile.autosave(withImplicitCancellability: false) { error in
if let error {
CodeFileDocument.logger.error("Failed to autosave document, error: \(error)")
} else {
codeFile.updateChangeCount(.changeCleared)
}
}
}
Expand Down

0 comments on commit d92b5d9

Please sign in to comment.