Struct freya::hooks::RopeEditor
source · pub struct RopeEditor { /* private fields */ }
Expand description
TextEditor implementing a Rope
Implementations§
source§impl RopeEditor
impl RopeEditor
pub fn new( text: String, cursor: TextCursor, mode: EditableMode, clipboard: UseClipboard, history: EditorHistory ) -> RopeEditor
pub fn rope(&self) -> &Rope
Trait Implementations§
source§impl Clone for RopeEditor
impl Clone for RopeEditor
source§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 moresource§impl Display for RopeEditor
impl Display for RopeEditor
source§impl TextEditor for RopeEditor
impl TextEditor for RopeEditor
type LinesIterator<'a> = LinesIterator<'a>
source§fn lines(&self) -> <RopeEditor as TextEditor>::LinesIterator<'_>
fn lines(&self) -> <RopeEditor as TextEditor>::LinesIterator<'_>
Iterator over all the lines in the text.
source§fn insert_char(&mut self, char: char, idx: usize)
fn insert_char(&mut self, char: char, idx: usize)
Insert a character in the text in the given position.
source§fn insert(&mut self, text: &str, idx: usize)
fn insert(&mut self, text: &str, idx: usize)
Insert a string in the text in the given position.
source§fn char_to_line(&self, char_idx: usize) -> usize
fn char_to_line(&self, char_idx: usize) -> usize
Get line from the given char
source§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
source§fn cursor(&self) -> &TextCursor
fn cursor(&self) -> &TextCursor
Get a readable cursor
source§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 get_clipboard(&mut self) -> &mut UseClipboard
fn has_any_highlight(&self) -> bool
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 get_selected_text(&self) -> Option<String>
fn get_selection(&self) -> Option<(usize, usize)>
fn undo(&mut self) -> Option<usize>
fn redo(&mut self) -> Option<usize>
source§fn cursor_row(&self) -> usize
fn cursor_row(&self) -> usize
Get the cursor row
source§fn cursor_col(&self) -> usize
fn cursor_col(&self) -> usize
Get the cursor column
source§fn cursor_down(&mut self)
fn cursor_down(&mut self)
Move the cursor 1 line down
source§fn cursor_right(&mut self)
fn cursor_right(&mut self)
Move the cursor 1 char to the right
source§fn cursor_left(&mut self)
fn cursor_left(&mut self)
Move the cursor 1 char to the left
source§fn cursor_pos(&self) -> usize
fn cursor_pos(&self) -> usize
Get the cursor position
source§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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.