aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/textinput.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r--components/script/textinput.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/components/script/textinput.rs b/components/script/textinput.rs
index 6dc24962aea..940b9919e76 100644
--- a/components/script/textinput.rs
+++ b/components/script/textinput.rs
@@ -106,9 +106,11 @@ impl TextInput {
let prefix_end = if forward {
self.edit_point.index
} else {
- //TODO: handle backspacing from position 0 of current line
if self.multiline {
- assert!(self.edit_point.index > 0);
+ //TODO: handle backspacing from position 0 of current line
+ if self.edit_point.index == 0 {
+ return;
+ }
} else if self.edit_point.index == 0 {
return;
}
@@ -118,7 +120,9 @@ impl TextInput {
let is_eol = self.edit_point.index == self.current_line_length() - 1;
if self.multiline {
//TODO: handle deleting from end position of current line
- assert!(!is_eol);
+ if is_eol {
+ return;
+ }
} else if is_eol {
return;
}