Struct freya::hooks::RopeEditor
pub struct RopeEditor { /* private fields */ }
Expand description
TextEditor implementing a Rope
Implementations§
§impl RopeEditor
impl RopeEditor
pub fn new(text: String, cursor: TextCursor, mode: EditableMode) -> RopeEditor
Trait Implementations§
§impl Clone for RopeEditor
impl Clone for RopeEditor
§fn clone(&self) -> RopeEditor
fn clone(&self) -> RopeEditor
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Display for RopeEditor
impl Display for RopeEditor
§impl TextEditor for RopeEditor
impl TextEditor for RopeEditor
type LinesIterator = LinesIterator<'a>
§fn lines(&self) -> <RopeEditor as TextEditor>::LinesIterator<'_>
fn lines(&self) -> <RopeEditor as TextEditor>::LinesIterator<'_>
Iterator over all the lines in the text.
§fn insert_char(&mut self, char: char, char_idx: usize)
fn insert_char(&mut self, char: char, char_idx: usize)
Insert a character in the text in the given position.
§fn insert(&mut self, text: &str, char_idx: usize)
fn insert(&mut self, text: &str, char_idx: usize)
Insert a string in the text in the given position.
§fn char_to_line(&self, char_idx: usize) -> usize
fn char_to_line(&self, char_idx: usize) -> usize
Get line from the given char
§fn line_to_char(&self, line_idx: usize) -> usize
fn line_to_char(&self, line_idx: usize) -> usize
Get the first char from the given line
§fn cursor(&self) -> &TextCursor
fn cursor(&self) -> &TextCursor
Get a readable cursor
§fn cursor_mut(&mut self) -> &mut TextCursor
fn cursor_mut(&mut self) -> &mut TextCursor
Get a mutable cursor
fn move_highlight_to_cursor(&mut self)
fn highlights(&self, editor_id: usize) -> Option<(usize, usize)>
fn set(&mut self, text: &str)
fn unhighlight(&mut self)
fn highlight_text(&mut self, from: usize, to: usize, editor_id: usize)
§fn cursor_row(&self) -> usize
fn cursor_row(&self) -> usize
Get the cursor row
§fn cursor_col(&self) -> usize
fn cursor_col(&self) -> usize
Get the cursor column
§fn cursor_down(&mut self)
fn cursor_down(&mut self)
Move the cursor 1 line down
§fn cursor_right(&mut self)
fn cursor_right(&mut self)
Move the cursor 1 char to the right
§fn cursor_left(&mut self)
fn cursor_left(&mut self)
Move the cursor 1 char to the left
§fn cursor_pos(&self) -> usize
fn cursor_pos(&self) -> usize
Get the cursor position
§fn set_cursor_pos(&mut self, pos: usize)
fn set_cursor_pos(&mut self, pos: usize)
Set the cursor position
fn process_key( &mut self, key: &Key, code: &Code, modifiers: &Modifiers ) -> TextEvent
Auto Trait Implementations§
impl RefUnwindSafe for RopeEditor
impl Send for RopeEditor
impl Sync for RopeEditor
impl Unpin for RopeEditor
impl UnwindSafe for RopeEditor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more