Add move_to method to Editor
This commit is contained in:
parent
63e9eeffb5
commit
4428f31b4f
4 changed files with 295 additions and 258 deletions
|
|
@ -190,6 +190,8 @@ impl text::Editor for () {
|
|||
|
||||
fn perform(&mut self, _action: text::editor::Action) {}
|
||||
|
||||
fn move_to(&mut self, _cursor: text::editor::Cursor) {}
|
||||
|
||||
fn bounds(&self) -> Size {
|
||||
Size::ZERO
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ pub trait Editor: Sized + Default {
|
|||
/// Performs an [`Action`] on the [`Editor`].
|
||||
fn perform(&mut self, action: Action);
|
||||
|
||||
/// Moves the cursor to the given position.
|
||||
fn move_to(&mut self, cursor: Cursor);
|
||||
|
||||
/// Returns the current boundaries of the [`Editor`].
|
||||
fn bounds(&self) -> Size;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue