This repository was archived by the owner on Apr 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -108,9 +108,9 @@ public void OnGUI() {
108
108
currentEvent . Use ( ) ;
109
109
}
110
110
111
- if ( this . _value != oldValue ) {
111
+ if ( this . _value != oldValue ) {
112
112
Window . instance . run ( ( ) => { TextInput . _updateEditingState ( this . _client , this . _value ) ; } ) ;
113
- }
113
+ }
114
114
}
115
115
116
116
public void Dispose ( ) {
Original file line number Diff line number Diff line change @@ -258,6 +258,23 @@ public TextEditingValue deleteSelection(bool backDelete = true) {
258
258
return this ;
259
259
}
260
260
261
+ if ( char . IsHighSurrogate ( this . text [ this . selection . start - 1 ] ) ) {
262
+ return this . copyWith (
263
+ text : this . text . Substring ( 0 , this . selection . start - 1 ) +
264
+ this . text . Substring ( this . selection . start + 1 ) ,
265
+ selection : TextSelection . collapsed ( this . selection . start - 1 ) ,
266
+ composing : TextRange . empty ) ;
267
+ }
268
+
269
+ if ( char . IsLowSurrogate ( this . text [ this . selection . start - 1 ] ) ) {
270
+ D . assert ( this . selection . start > 1 ) ;
271
+ return this . copyWith (
272
+ text : this . text . Substring ( 0 , this . selection . start - 2 ) +
273
+ this . selection . textAfter ( this . text ) ,
274
+ selection : TextSelection . collapsed ( this . selection . start - 2 ) ,
275
+ composing : TextRange . empty ) ;
276
+ }
277
+
261
278
return this . copyWith (
262
279
text : this . text . Substring ( 0 , this . selection . start - 1 ) + this . selection . textAfter ( this . text ) ,
263
280
selection : TextSelection . collapsed ( this . selection . start - 1 ) ,
You can’t perform that action at this time.
0 commit comments