pub enum TextMovement {
Left,
Right,
WordLeft,
WordRight,
LineStart,
LineEnd,
DocumentStart,
DocumentEnd,
LineUp,
LineDown,
PageUp,
PageDown,
}Expand description
Caret movement direction for keyboard navigation.
Horizontal character movement follows Unicode extended grapheme clusters. Words are whitespace-delimited; punctuation remains part of a word. Vertical movement uses newline-delimited logical lines and preserves a grapheme column, not shaped X geometry. Page movement is exactly ten logical lines.
§Examples
use ailloli_ui_text::TextMovement;
assert_ne!(TextMovement::Left, TextMovement::WordLeft);
assert_ne!(TextMovement::LineUp, TextMovement::PageUp);Variants§
Left
Move to the previous extended grapheme boundary.
Right
Move to the next extended grapheme boundary.
WordLeft
Move left across whitespace and then to the current word’s start.
WordRight
Move right across whitespace and through the next non-whitespace run.
LineStart
Move after the previous newline, or byte zero on the first line.
LineEnd
Move before the next newline, or to document end on the last line.
DocumentStart
Move to UTF-8 byte zero.
DocumentEnd
Move to the document’s UTF-8 byte length.
LineUp
Move one logical line up at the same grapheme column when possible.
LineDown
Move one logical line down at the same grapheme column when possible.
PageUp
Move ten logical lines up at the same grapheme column when possible.
PageDown
Move ten logical lines down at the same grapheme column when possible.
Trait Implementations§
Source§impl Clone for TextMovement
impl Clone for TextMovement
Source§fn clone(&self) -> TextMovement
fn clone(&self) -> TextMovement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextMovement
impl Debug for TextMovement
Source§impl PartialEq for TextMovement
impl PartialEq for TextMovement
impl Copy for TextMovement
impl Eq for TextMovement
impl StructuralPartialEq for TextMovement
Auto Trait Implementations§
impl Freeze for TextMovement
impl RefUnwindSafe for TextMovement
impl Send for TextMovement
impl Sync for TextMovement
impl Unpin for TextMovement
impl UnwindSafe for TextMovement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.