diff options
Diffstat (limited to 'native/src')
-rw-r--r-- | native/src/widget/text_input/editor.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/native/src/widget/text_input/editor.rs b/native/src/widget/text_input/editor.rs index de235d52..30025016 100644 --- a/native/src/widget/text_input/editor.rs +++ b/native/src/widget/text_input/editor.rs @@ -47,8 +47,8 @@ impl<'a> Editor<'a> { pub fn backspace(&mut self) { match self.cursor.selection() { Some((start, end)) => { - self.value.remove_many(start, end); self.cursor.move_left(&self.value); + self.value.remove_many(start, end); } None => { let start = self.cursor.start(&self.value); @@ -64,9 +64,8 @@ impl<'a> Editor<'a> { pub fn delete(&mut self) { match self.cursor.selection() { - Some((start, end)) => { - self.value.remove_many(start, end); - self.cursor.move_left(&self.value); + Some(_) => { + self.backspace(); } None => { let end = self.cursor.end(&self.value); |