This repository was archived by the owner on Apr 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -501,11 +501,20 @@ void _handleShortcuts(KeyCommand cmd) {
501
501
void _handleDelete ( ) {
502
502
var selection = this . selection ;
503
503
if ( selection . textAfter ( this . text . text ) . isNotEmpty ( ) ) {
504
- this . textSelectionDelegate . textEditingValue = new TextEditingValue (
505
- text : selection . textBefore ( this . text . text )
506
- + selection . textAfter ( this . text . text ) . Substring ( 1 ) ,
507
- selection : TextSelection . collapsed ( offset : selection . start )
508
- ) ;
504
+ if ( char . IsLowSurrogate ( this . text . text [ selection . end ] ) ) {
505
+ this . textSelectionDelegate . textEditingValue = new TextEditingValue (
506
+ text : selection . textBefore ( this . text . text )
507
+ + selection . textAfter ( this . text . text ) . Substring ( 2 ) ,
508
+ selection : TextSelection . collapsed ( offset : selection . start )
509
+ ) ;
510
+ }
511
+ else {
512
+ this . textSelectionDelegate . textEditingValue = new TextEditingValue (
513
+ text : selection . textBefore ( this . text . text )
514
+ + selection . textAfter ( this . text . text ) . Substring ( 1 ) ,
515
+ selection : TextSelection . collapsed ( offset : selection . start )
516
+ ) ;
517
+ }
509
518
}
510
519
else {
511
520
this . textSelectionDelegate . textEditingValue = new TextEditingValue (
You can’t perform that action at this time.
0 commit comments