mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
style
This commit is contained in:
@ -1041,8 +1041,7 @@ extension Ghostty.SurfaceView: NSServicesMenuRequestor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func readSelection(from pboard: NSPasteboard) -> Bool {
|
func readSelection(from pboard: NSPasteboard) -> Bool {
|
||||||
guard let str = pboard.getOpinionatedStringContents()
|
guard let str = pboard.getOpinionatedStringContents() else { return false }
|
||||||
else { return false }
|
|
||||||
|
|
||||||
let len = str.utf8CString.count
|
let len = str.utf8CString.count
|
||||||
if (len == 0) { return true }
|
if (len == 0) { return true }
|
||||||
|
@ -7,8 +7,7 @@ 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? {
|
||||||
let file = self.string(forType: .fileURL)
|
if let file = self.string(forType: .fileURL) {
|
||||||
if let file = file {
|
|
||||||
if let path = NSURL(string: file)?.path {
|
if let path = NSURL(string: file)?.path {
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user