summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-25 14:03:15 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-25 14:03:15 +0100
commitcb32326fe6a57c3b4989741d88998fcafbf8e1ef (patch)
tree5be3a3ff68bffa72ce18aace228f5005bc8949ce /native
parent30f02345a88fc03a5a71d6563f385ac090063bce (diff)
downloadiced-cb32326fe6a57c3b4989741d88998fcafbf8e1ef.tar.gz
iced-cb32326fe6a57c3b4989741d88998fcafbf8e1ef.tar.bz2
iced-cb32326fe6a57c3b4989741d88998fcafbf8e1ef.zip
Fix edge cases when inserting text in `Editor`
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/text_input/editor.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/native/src/widget/text_input/editor.rs b/native/src/widget/text_input/editor.rs
index 30025016..37093a70 100644
--- a/native/src/widget/text_input/editor.rs
+++ b/native/src/widget/text_input/editor.rs
@@ -17,8 +17,8 @@ impl<'a> Editor<'a> {
pub fn insert(&mut self, character: char) {
match self.cursor.selection() {
Some((left, right)) => {
- self.value.remove_many(left, right);
self.cursor.move_left(&self.value);
+ self.value.remove_many(left, right);
}
_ => (),
}
@@ -32,8 +32,8 @@ impl<'a> Editor<'a> {
match self.cursor.selection() {
Some((left, right)) => {
- self.value.remove_many(left, right);
self.cursor.move_left(&self.value);
+ self.value.remove_many(left, right);
}
_ => (),
}