Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions CodeEdit/Documents/CodeEditDocumentController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ extension NSDocumentController {
dialog.begin { result in
if result == NSApplication.ModalResponse.OK, let url = dialog.url {
self.openDocument(withContentsOf: url, display: true) { document, documentWasAlreadyOpen, error in
// TODO: handle errors
if let error = error {
print("Error: \(error.localizedDescription)")
NSAlert(error: error).runModal()
return
}

guard let document = document else {
print("Error: Failed to get document")
let alert = NSAlert()
alert.messageText = NSLocalizedString("Failed to get document",
comment: "Failed to get document")
alert.runModal()
return
}
var recentProjectPaths: [String] = UserDefaults.standard.array(
Expand Down
2 changes: 1 addition & 1 deletion CodeEdit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>public.source-code</string>
<string>public.item</string>
</array>
<key>NSDocumentClass</key>
<string>CodeFileDocument</string>
Expand Down