Fixed bug in textinput::adjust_vertical concerning selection_origin update

This bug was discovered using the F* formal verification framework.

Style changes (match -> if let)

Replace if let Some(_) by .is_some()
This commit is contained in:
Denis Merigoux 2018-12-14 14:21:50 +01:00
parent 9ca6768a56
commit e1ea8fbd35
2 changed files with 26 additions and 1 deletions

View file

@ -318,6 +318,10 @@ fn test_textinput_adjust_vertical() {
textinput.adjust_vertical(2, Selection::NotSelected);
assert_eq!(textinput.edit_point().line, 2);
assert_eq!(textinput.edit_point().index, 1);
textinput.adjust_vertical(-1, Selection::Selected);
assert_eq!(textinput.edit_point().line, 1);
assert_eq!(textinput.edit_point().index, 1);
}
#[test]