added move_cursor_to
This commit is contained in:
parent
0d119aa731
commit
98cf9c455a
1 changed files with 8 additions and 0 deletions
|
|
@ -699,6 +699,14 @@ impl State {
|
|||
pub fn move_cursor_to_end(&mut self, value: &String) {
|
||||
self.cursor.move_to(value.len());
|
||||
}
|
||||
|
||||
/// Moves the [`Cursor`] of the [`TextInput`] to an arbitrary location.
|
||||
///
|
||||
/// [`Cursor`]: struct.Cursor.html
|
||||
/// [`TextInput`]: struct.TextInput.html
|
||||
pub fn move_cursor_to(&mut self, position: usize) {
|
||||
self.cursor.move_to(position);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Reduce allocations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue