|
|
|
|
|
|
void _handleDelete() { |
|
|
|
var selection = this.selection; |
|
|
|
if (selection.textAfter(this.text.text).isNotEmpty()) { |
|
|
|
this.textSelectionDelegate.textEditingValue = new TextEditingValue( |
|
|
|
text: selection.textBefore(this.text.text) |
|
|
|
+ selection.textAfter(this.text.text).Substring(1), |
|
|
|
selection: TextSelection.collapsed(offset: selection.start) |
|
|
|
); |
|
|
|
if (char.IsLowSurrogate(this.text.text[selection.end])) { |
|
|
|
this.textSelectionDelegate.textEditingValue = new TextEditingValue( |
|
|
|
text: selection.textBefore(this.text.text) |
|
|
|
+ selection.textAfter(this.text.text).Substring(2), |
|
|
|
selection: TextSelection.collapsed(offset: selection.start) |
|
|
|
); |
|
|
|
} |
|
|
|
else { |
|
|
|
this.textSelectionDelegate.textEditingValue = new TextEditingValue( |
|
|
|
text: selection.textBefore(this.text.text) |
|
|
|
+ selection.textAfter(this.text.text).Substring(1), |
|
|
|
selection: TextSelection.collapsed(offset: selection.start) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
this.textSelectionDelegate.textEditingValue = new TextEditingValue( |
|
|
|