mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Find the correct column index in adjust_vertical
This commit is contained in:
parent
e17ed2e6b0
commit
29fb3f1150
2 changed files with 17 additions and 1 deletions
|
@ -301,8 +301,11 @@ impl<T: ClipboardProvider> TextInput<T> {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
let col = self.lines[self.edit_point.line][..self.edit_point.index].chars().count();
|
||||
|
||||
self.edit_point.line = target_line as usize;
|
||||
self.edit_point.index = min(self.current_line_length(), self.edit_point.index);
|
||||
self.edit_point.index = len_of_first_n_chars(&self.lines[self.edit_point.line], col);
|
||||
}
|
||||
|
||||
/// Adjust the editing point position by a given number of bytes. If the adjustment
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue