Skip to main content

TextCursorExt

Trait TextCursorExt 

Source
pub trait TextCursorExt<This>
where This: TextEditorStateAlg,
{ // Required methods fn insert_text(&mut self, insertion: &str); fn delete_before_cursor(&mut self); fn delete_at_cursor(&mut self); fn move_cursor_left(&mut self); fn move_cursor_right(&mut self); fn move_cursor_home(&mut self); fn move_cursor_end(&mut self); }
Expand description

Derives UTF-8-safe text editing independently of a renderer.

Required Methods§

Source

fn insert_text(&mut self, insertion: &str)

Inserts text at the active cursor and advances past the insertion.

Source

fn delete_before_cursor(&mut self)

Deletes the Unicode scalar immediately preceding the active cursor.

Source

fn delete_at_cursor(&mut self)

Deletes the Unicode scalar at the active cursor.

Source

fn move_cursor_left(&mut self)

Moves the active cursor one Unicode scalar to the left.

Source

fn move_cursor_right(&mut self)

Moves the active cursor one Unicode scalar to the right.

Source

fn move_cursor_home(&mut self)

Moves the active cursor to the beginning of its logical line.

Source

fn move_cursor_end(&mut self)

Moves the active cursor to the end of its logical line.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<This> TextCursorExt<This> for This
where This: TextEditorStateAlg,

Derives UTF-8-safe text editing independently of a renderer.