[][src]Enum alacritty::selection::Selection

pub enum Selection {
    Simple {
        region: Range<Anchor>,
    },
    Semantic {
        region: Range<Point<isize>>,
    },
    Lines {
        region: Range<Point<isize>>,
        initial_line: isize,
    },
}

Describes a region of a 2-dimensional area

Used to track a text selection. There are three supported modes, each with its own constructor: simple, semantic, and lines. The simple mode precisely tracks which cells are selected without any expansion. semantic mode expands the initial selection to the nearest semantic escape char in either direction. lines will always select entire lines.

Calls to [update] operate different based on the selection kind. The simple mode does nothing special, simply tracks points and sides. semantic will continue to expand out to semantic boundaries as the selection point changes. Similarly, lines will always expand the new point to encompass entire lines.

Variants

Simple

Fields of Simple

region: Range<Anchor>

The region representing start and end of cursor movement

Semantic

Fields of Semantic

region: Range<Point<isize>>

The region representing start and end of cursor movement

Lines

Fields of Lines

region: Range<Point<isize>>

The region representing start and end of cursor movement

initial_line: isize

The line under the initial point. This is always selected regardless of which way the cursor is moved.

Methods

impl Selection[src]

pub fn simple(location: Point<usize>, side: Side) -> Selection[src]

pub fn rotate(&mut self, offset: isize)[src]

pub fn semantic(point: Point<usize>) -> Selection[src]

pub fn lines(point: Point<usize>) -> Selection[src]

pub fn update(&mut self, location: Point<usize>, side: Side)[src]

pub fn to_span<G>(&self, grid: &G, alt_screen: bool) -> Option<Span> where
    G: Search + Dimensions
[src]

pub fn is_empty(&self) -> bool[src]

Trait Implementations

impl Clone for Selection[src]

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

Performs copy-assignment from source. Read more

impl PartialEq<Selection> for Selection[src]

impl Debug for Selection[src]

Auto Trait Implementations

impl Send for Selection

impl Sync for Selection

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.

impl<T> Erased for T[src]