Enum liner::CursorPosition [] [src]

pub enum CursorPosition {
    InWord(usize),
    OnWordLeftEdge(usize),
    OnWordRightEdge(usize),
    InSpace(Option<usize>, Option<usize>),
}

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.

Methods

impl CursorPosition
[src]

fn get(cursor: usize, words: &[(usize, usize)]) -> CursorPosition

Trait Implementations

impl Eq for CursorPosition
[src]

impl PartialEq for CursorPosition
[src]

fn eq(&self, __arg_0: &CursorPosition) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &CursorPosition) -> bool

This method tests for !=.

impl Copy for CursorPosition
[src]

impl Clone for CursorPosition
[src]

fn clone(&self) -> CursorPosition

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Debug for CursorPosition
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.