mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
macos: paste multiple files separated by space (#4956)
https://github.com/ghostty-org/ghostty/discussions/4892#discussioncomment-11808631
This commit is contained in:
@ -13,11 +13,11 @@ extension NSPasteboard {
|
|||||||
/// - Tries to get any string from the pasteboard.
|
/// - Tries to get any string from the pasteboard.
|
||||||
/// If all of the above fail, returns None.
|
/// If all of the above fail, returns None.
|
||||||
func getOpinionatedStringContents() -> String? {
|
func getOpinionatedStringContents() -> String? {
|
||||||
if let file = self.string(forType: .fileURL) {
|
if let urls = readObjects(forClasses: [NSURL.self]) as? [URL],
|
||||||
if let path = NSURL(string: file)?.path {
|
urls.count > 0 {
|
||||||
return path
|
return urls.map { $0.path }.joined(separator: " ")
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self.string(forType: .string)
|
return self.string(forType: .string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user