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
2 changes: 1 addition & 1 deletion CodeEdit/Features/Documents/WorkspaceDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ import CodeEditKit
workspace: self
)

windowController.shouldCascadeWindows = false
windowController.shouldCascadeWindows = true
windowController.window?.setFrameAutosaveName(self.fileURL?.absoluteString ?? "Untitled")
self.addWindowController(windowController)

Expand Down
16 changes: 16 additions & 0 deletions CodeEdit/Features/Welcome/Views/WelcomeWindowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,21 @@ struct WelcomeWindowView: View {
.frame(width: 300)
}
.edgesIgnoringSafeArea(.top)
.onDrop(of: [.fileURL], isTargeted: .constant(true)) { providers in
NSApp.activate(ignoringOtherApps: true)
providers.forEach {
_ = $0.loadDataRepresentation(for: .fileURL) { data, _ in
if let data, let url = URL(dataRepresentation: data, relativeTo: nil) {
Task {
try? await CodeEditDocumentController
.shared
.openDocument(withContentsOf: url, display: true)
}
}
}
}
dismissWindow()
return true
}
}
}