Implement methods to query the contents of a TextEditor
This commit is contained in:
parent
f7fc13d98c
commit
c6d0443627
4 changed files with 107 additions and 0 deletions
|
|
@ -9,6 +9,12 @@ pub trait Editor: Sized + Default {
|
|||
|
||||
fn cursor(&self) -> Cursor;
|
||||
|
||||
fn selection(&self) -> Option<String>;
|
||||
|
||||
fn line(&self, index: usize) -> Option<&str>;
|
||||
|
||||
fn line_count(&self) -> usize;
|
||||
|
||||
fn perform(&mut self, action: Action);
|
||||
|
||||
/// Returns the current boundaries of the [`Editor`].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue