sketch of move_cursor_to commands
This commit is contained in:
parent
ca6ff874a1
commit
6a2c73d0e0
1 changed files with 16 additions and 0 deletions
|
|
@ -683,6 +683,22 @@ impl State {
|
|||
pub fn cursor(&self) -> Cursor {
|
||||
self.cursor
|
||||
}
|
||||
|
||||
/// Moves the [`Cursor`] of the [`TextInput`] to the front of the input text.
|
||||
///
|
||||
/// [`Cursor`]: struct.Cursor.html
|
||||
/// [`TextInput`]: struct.TextInput.html
|
||||
pub fn move_cursor_to_front(&mut self) {
|
||||
self.cursor.move_to(0);
|
||||
}
|
||||
|
||||
/// Moves the [`Cursor`] of the [`TextInput`] to the end of the input text.
|
||||
///
|
||||
/// [`Cursor`]: struct.Cursor.html
|
||||
/// [`TextInput`]: struct.TextInput.html
|
||||
pub fn move_cursor_to_end(&mut self) {
|
||||
self.cursor.move_to(5000);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Reduce allocations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue