macOS: enable copy only when there’s actual selected text
parent
6590196661
commit
6fdca6bb53
|
|
@ -2121,6 +2121,14 @@ extension Ghostty.SurfaceView: NSMenuItemValidation {
|
||||||
item.state = readonly ? .on : .off
|
item.state = readonly ? .on : .off
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
case #selector(copy(_:)):
|
||||||
|
// We only enable copy menu item when there're actual selected text
|
||||||
|
if let text = self.accessibilitySelectedText(), text.count > 0 {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue