mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(macos): keep Return for IME marked text commit (#25178)
Co-authored-by: jft0m <9837901+bottotl@users.noreply.github.com>
This commit is contained in:
@@ -185,6 +185,11 @@ private final class TranscriptNSTextView: NSTextView {
|
||||
self.onEscape?()
|
||||
return
|
||||
}
|
||||
// Keep IME candidate confirmation behavior: Return should commit marked text first.
|
||||
if isReturn, self.hasMarkedText() {
|
||||
super.keyDown(with: event)
|
||||
return
|
||||
}
|
||||
if isReturn, event.modifierFlags.contains(.command) {
|
||||
self.onSend?()
|
||||
return
|
||||
|
||||
@@ -486,6 +486,10 @@ private final class ChatComposerNSTextView: NSTextView {
|
||||
override func keyDown(with event: NSEvent) {
|
||||
let isReturn = event.keyCode == 36
|
||||
if isReturn {
|
||||
if self.hasMarkedText() {
|
||||
super.keyDown(with: event)
|
||||
return
|
||||
}
|
||||
if event.modifierFlags.contains(.shift) {
|
||||
super.insertNewline(nil)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user