This commit is contained in:
Qwerasd
2024-03-08 13:24:01 -05:00
parent d1ac0aff39
commit bd03b19679
2 changed files with 2 additions and 4 deletions

View File

@ -1041,8 +1041,7 @@ extension Ghostty.SurfaceView: NSServicesMenuRequestor {
}
func readSelection(from pboard: NSPasteboard) -> Bool {
guard let str = pboard.getOpinionatedStringContents()
else { return false }
guard let str = pboard.getOpinionatedStringContents() else { return false }
let len = str.utf8CString.count
if (len == 0) { return true }

View File

@ -7,8 +7,7 @@ extension NSPasteboard {
/// - Tries to get any string from the pasteboard.
/// If all of the above fail, returns None.
func getOpinionatedStringContents() -> String? {
let file = self.string(forType: .fileURL)
if let file = file {
if let file = self.string(forType: .fileURL) {
if let path = NSURL(string: file)?.path {
return path
}