pub struct MutableSelectionsCollection<'a> { /* private fields */ }

Implementations§

source§

impl<'a> MutableSelectionsCollection<'a>

source

pub fn display_map(&mut self) -> DisplaySnapshot

source

pub fn clear_disjoint(&mut self)

source

pub fn delete(&mut self, selection_id: usize)

source

pub fn clear_pending(&mut self)

source

pub fn set_pending_anchor_range( &mut self, range: Range<Anchor>, mode: SelectMode )

source

pub fn set_pending_display_range( &mut self, range: Range<DisplayPoint>, mode: SelectMode )

source

pub fn set_pending(&mut self, selection: Selection<Anchor>, mode: SelectMode)

source

pub fn try_cancel(&mut self) -> bool

source

pub fn insert_range<T>(&mut self, range: Range<T>)where T: 'a + ToOffset + ToPoint + TextDimension + Ord + Sub<T, Output = T> + Copy,

source

pub fn select<T>(&mut self, selections: Vec<Selection<T>>)where T: ToOffset + ToPoint + Ord + Copy + Debug,

source

pub fn select_anchors(&mut self, selections: Vec<Selection<Anchor>>)

source

pub fn select_ranges<I, T>(&mut self, ranges: I)where I: IntoIterator<Item = Range<T>>, T: ToOffset,

source

pub fn select_anchor_ranges<I: IntoIterator<Item = Range<Anchor>>>( &mut self, ranges: I )

source

pub fn new_selection_id(&mut self) -> usize

source

pub fn select_display_ranges<T>(&mut self, ranges: T)where T: IntoIterator<Item = Range<DisplayPoint>>,

source

pub fn move_with( &mut self, move_selection: impl FnMut(&DisplaySnapshot, &mut Selection<DisplayPoint>) )

source

pub fn move_offsets_with( &mut self, move_selection: impl FnMut(&MultiBufferSnapshot, &mut Selection<usize>) )

source

pub fn move_heads_with( &mut self, update_head: impl FnMut(&DisplaySnapshot, DisplayPoint, SelectionGoal) -> (DisplayPoint, SelectionGoal) )

source

pub fn move_cursors_with( &mut self, update_cursor_position: impl FnMut(&DisplaySnapshot, DisplayPoint, SelectionGoal) -> (DisplayPoint, SelectionGoal) )

source

pub fn maybe_move_cursors_with( &mut self, update_cursor_position: impl FnMut(&DisplaySnapshot, DisplayPoint, SelectionGoal) -> Option<(DisplayPoint, SelectionGoal)> )

source

pub fn replace_cursors_with( &mut self, find_replacement_cursors: impl FnMut(&DisplaySnapshot) -> Vec<DisplayPoint> )

source

pub fn refresh(&mut self) -> HashMap<usize, ExcerptId>

Compute new ranges for any selections that were located in excerpts that have since been removed.

Returns a HashMap indicating which selections whose former head position was no longer present. The keys of the map are selection ids. The values are the id of the new excerpt where the head of the selection has been moved.

Methods from Deref<Target = SelectionsCollection>§

source

pub fn display_map(&self, cx: &mut AppContext) -> DisplaySnapshot

source

pub fn clone_state(&mut self, other: &SelectionsCollection)

source

pub fn count(&self) -> usize

source

pub fn disjoint_anchors(&self) -> Arc<[Selection<Anchor>]>

The non-pending, non-overlapping selections. There could still be a pending selection that overlaps these if the mouse is being dragged, etc. Returned as selections over Anchors.

source

pub fn pending_anchor(&self) -> Option<Selection<Anchor>>

source

pub fn pending<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Option<Selection<D>>

source

pub fn pending_mode(&self) -> Option<SelectMode>

source

pub fn all<'a, D>(&self, cx: &AppContext) -> Vec<Selection<D>>where D: 'a + TextDimension + Ord + Sub<D, Output = D> + Debug,

source

pub fn all_adjusted(&self, cx: &mut AppContext) -> Vec<Selection<Point>>

Returns all of the selections, adjusted to take into account the selection line_mode

source

pub fn all_adjusted_display( &self, cx: &mut AppContext ) -> (DisplaySnapshot, Vec<Selection<DisplayPoint>>)

source

pub fn disjoint_in_range<'a, D>( &self, range: Range<Anchor>, cx: &AppContext ) -> Vec<Selection<D>>where D: 'a + TextDimension + Ord + Sub<D, Output = D> + Debug,

source

pub fn all_display( &self, cx: &mut AppContext ) -> (DisplaySnapshot, Vec<Selection<DisplayPoint>>)

source

pub fn newest_anchor(&self) -> &Selection<Anchor>

source

pub fn newest<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>

source

pub fn newest_display(&self, cx: &mut AppContext) -> Selection<DisplayPoint>

source

pub fn oldest_anchor(&self) -> &Selection<Anchor>

source

pub fn oldest<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>

source

pub fn first_anchor(&self) -> Selection<Anchor>

source

pub fn first<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>

source

pub fn last<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>

source

pub fn build_columnar_selection( &mut self, display_map: &DisplaySnapshot, row: u32, positions: &Range<Pixels>, reversed: bool, text_layout_details: &TextLayoutDetails ) -> Option<Selection<Point>>

Trait Implementations§

source§

impl<'a> Deref for MutableSelectionsCollection<'a>

§

type Target = SelectionsCollection

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a> DerefMut for MutableSelectionsCollection<'a>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,