File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -224,7 +224,10 @@ void MacosInputContext::commitStringImpl(const std::string &text) {
224
224
// committed in next commit with a key event. e.g. fcitx commits a ,
225
225
// asynchronously when deleting , after a number/English character.
226
226
if (!isSyncEvent) {
227
- commitAndSetPreeditAsync ();
227
+ // When changing this, test Messages.app by clicking a candidate.
228
+ // Previously buggy behavior is that preedit is appended after commit.
229
+ SwiftFrontend::commitAsync (client_, state_.commit );
230
+ resetState ();
228
231
}
229
232
}
230
233
Original file line number Diff line number Diff line change @@ -70,6 +70,16 @@ public func commitAndSetPreeditAsync(
70
70
}
71
71
}
72
72
73
+ public func commitAsync( _ clientPtr: UnsafeMutableRawPointer , _ commit: String ) {
74
+ let client : AnyObject = Unmanaged . fromOpaque ( clientPtr) . takeUnretainedValue ( )
75
+ guard let client = client as? IMKTextInput else {
76
+ return
77
+ }
78
+ DispatchQueue . main. async {
79
+ commitString ( client, commit)
80
+ }
81
+ }
82
+
73
83
public func getCursorCoordinates(
74
84
_ clientPtr: UnsafeMutableRawPointer ,
75
85
_ followCursor: Bool ,
You can’t perform that action at this time.
0 commit comments