mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Fix crash in textinput
This commit is contained in:
parent
905c30d697
commit
f686943eb4
1 changed files with 7 additions and 1 deletions
|
@ -295,6 +295,12 @@ impl TextInput {
|
||||||
vec!(content)
|
vec!(content)
|
||||||
};
|
};
|
||||||
self.edit_point.line = min(self.edit_point.line, self.lines.len() - 1);
|
self.edit_point.line = min(self.edit_point.line, self.lines.len() - 1);
|
||||||
self.edit_point.index = min(self.edit_point.index, self.current_line_length() - 1);
|
|
||||||
|
if self.current_line_length() == 0 {
|
||||||
|
self.edit_point.index = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
self.edit_point.index = min(self.edit_point.index, self.current_line_length() - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue