pub enum CursorPosition {
InWord(usize),
OnWordLeftEdge(usize),
OnWordRightEdge(usize),
InSpace(Option<usize>, Option<usize>),
}
Expand description
Represents the position of the cursor relative to words in the buffer.
Variants§
InWord(usize)
The cursor is in the word with the specified index.
OnWordLeftEdge(usize)
The cursor is on the left edge of the word with the specified index.
For example: abc |hi
, where |
is the cursor.
OnWordRightEdge(usize)
The cursor is on the right edge of the word with the specified index.
For example: abc| hi
, where |
is the cursor.
InSpace(Option<usize>, Option<usize>)
The cursor is not in contact with any word. Each Option<usize>
specifies the index of the
closest word to the left and right, respectively, or None
if there is no word on that side.
Implementations§
Trait Implementations§
Source§impl Clone for CursorPosition
impl Clone for CursorPosition
Source§fn clone(&self) -> CursorPosition
fn clone(&self) -> CursorPosition
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 Debug for CursorPosition
impl Debug for CursorPosition
Source§impl PartialEq for CursorPosition
impl PartialEq for CursorPosition
impl Copy for CursorPosition
impl Eq for CursorPosition
impl StructuralPartialEq for CursorPosition
Auto Trait Implementations§
impl Freeze for CursorPosition
impl RefUnwindSafe for CursorPosition
impl Send for CursorPosition
impl Sync for CursorPosition
impl Unpin for CursorPosition
impl UnwindSafe for CursorPosition
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