[−][src]Struct alacritty_terminal::selection::Selection
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]
self,
dimensions: &D,
range: &Range<Line>,
delta: isize
) -> Option<Selection>
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
impl RefUnwindSafe for Selection
impl Send for Selection
impl Sync for Selection
impl Unpin for Selection
impl UnwindSafe for Selection
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,