[][src]Struct alacritty_terminal::selection::Selection

pub struct Selection {
    pub ty: SelectionType,
    // some fields omitted
}

Describes a region of a 2-dimensional area.

Used to track a text selection. There are four supported modes, each with its own constructor: simple, block, semantic, and lines. The simple mode precisely tracks which cells are selected without any expansion. block will select rectangular regions. 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 and block mode do nothing special, simply track 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.

Fields

ty: SelectionType

Implementations

impl Selection[src]

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

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

Update the end of the selection.

pub fn rotate<D: Dimensions>(
    self,
    dimensions: &D,
    range: &Range<Line>,
    delta: isize
) -> Option<Selection>
[src]

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

pub fn intersects_range<R: RangeBounds<usize>>(&self, range: R) -> bool[src]

Check whether selection contains any point in a given range.

pub fn include_all(&mut self)[src]

Expand selection sides to include all cells.

pub fn to_range<T>(&self, term: &Term<T>) -> Option<SelectionRange>[src]

Convert selection to grid coordinates.

Trait Implementations

impl Clone for Selection[src]

impl Debug for Selection[src]

impl PartialEq<Selection> for Selection[src]

impl StructuralPartialEq for Selection[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.