mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Find the correct column index in adjust_vertical
This commit is contained in:
@@ -244,6 +244,19 @@ fn test_textinput_adjust_vertical() {
|
||||
assert_eq!(textinput.edit_point.index, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_textinput_adjust_vertical_multibyte() {
|
||||
let mut textinput = text_input(Lines::Multiple, "áé\nae");
|
||||
|
||||
textinput.adjust_horizontal_by_one(Direction::Forward, Selection::NotSelected);
|
||||
assert_eq!(textinput.edit_point.line, 0);
|
||||
assert_eq!(textinput.edit_point.index, 2);
|
||||
|
||||
textinput.adjust_vertical(1, Selection::NotSelected);
|
||||
assert_eq!(textinput.edit_point.line, 1);
|
||||
assert_eq!(textinput.edit_point.index, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_textinput_adjust_horizontal() {
|
||||
let mut textinput = text_input(Lines::Multiple, "abc\nde\nf");
|
||||
|
||||
Reference in New Issue
Block a user