Skip to content

Commit

Permalink
Fix for excessive files in recents list (#1114)
Browse files Browse the repository at this point in the history
fix for excessive files in recents list

Signed-off-by: Wouter01 <[email protected]>
  • Loading branch information
Wouter01 authored Mar 7, 2023
1 parent 5659ba0 commit 43d4cfd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ final class CodeEditDocumentController: NSDocumentController {
return panel.url
}

override func noteNewRecentDocument(_ document: NSDocument) {
// The super method is run manually when opening new documents.
}

override func openDocument(_ sender: Any?) {
self.openDocument(onCompletion: { document, documentWasAlreadyOpen in
// TODO: handle errors
Expand All @@ -55,6 +59,7 @@ final class CodeEditDocumentController: NSDocumentController {
display displayDocument: Bool,
completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void
) {
super.noteNewRecentDocumentURL(url)
super.openDocument(withContentsOf: url, display: displayDocument) { document, documentWasAlreadyOpen, error in

if let document = document {
Expand Down

0 comments on commit 43d4cfd

Please sign in to comment.