pub struct MutableSelectionsCollection<'a> { /* private fields */ }
Implementations§
source§impl<'a> MutableSelectionsCollection<'a>
impl<'a> MutableSelectionsCollection<'a>
pub fn display_map(&mut self) -> DisplaySnapshot
pub fn clear_disjoint(&mut self)
pub fn delete(&mut self, selection_id: usize)
pub fn clear_pending(&mut self)
pub fn set_pending_anchor_range( &mut self, range: Range<Anchor>, mode: SelectMode )
pub fn set_pending_display_range( &mut self, range: Range<DisplayPoint>, mode: SelectMode )
pub fn set_pending(&mut self, selection: Selection<Anchor>, mode: SelectMode)
pub fn try_cancel(&mut self) -> bool
pub fn insert_range<T>(&mut self, range: Range<T>)where T: 'a + ToOffset + ToPoint + TextDimension + Ord + Sub<T, Output = T> + Copy,
pub fn select<T>(&mut self, selections: Vec<Selection<T>>)where T: ToOffset + ToPoint + Ord + Copy + Debug,
pub fn select_anchors(&mut self, selections: Vec<Selection<Anchor>>)
pub fn select_ranges<I, T>(&mut self, ranges: I)where I: IntoIterator<Item = Range<T>>, T: ToOffset,
pub fn select_anchor_ranges<I: IntoIterator<Item = Range<Anchor>>>( &mut self, ranges: I )
pub fn new_selection_id(&mut self) -> usize
pub fn select_display_ranges<T>(&mut self, ranges: T)where T: IntoIterator<Item = Range<DisplayPoint>>,
pub fn move_with( &mut self, move_selection: impl FnMut(&DisplaySnapshot, &mut Selection<DisplayPoint>) )
pub fn move_offsets_with( &mut self, move_selection: impl FnMut(&MultiBufferSnapshot, &mut Selection<usize>) )
pub fn move_heads_with( &mut self, update_head: impl FnMut(&DisplaySnapshot, DisplayPoint, SelectionGoal) -> (DisplayPoint, SelectionGoal) )
pub fn move_cursors_with( &mut self, update_cursor_position: impl FnMut(&DisplaySnapshot, DisplayPoint, SelectionGoal) -> (DisplayPoint, SelectionGoal) )
pub fn maybe_move_cursors_with( &mut self, update_cursor_position: impl FnMut(&DisplaySnapshot, DisplayPoint, SelectionGoal) -> Option<(DisplayPoint, SelectionGoal)> )
pub fn replace_cursors_with( &mut self, find_replacement_cursors: impl FnMut(&DisplaySnapshot) -> Vec<DisplayPoint> )
sourcepub fn refresh(&mut self) -> HashMap<usize, ExcerptId>
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>§
pub fn display_map(&self, cx: &mut AppContext) -> DisplaySnapshot
pub fn clone_state(&mut self, other: &SelectionsCollection)
pub fn count(&self) -> usize
sourcepub fn disjoint_anchors(&self) -> Arc<[Selection<Anchor>]>
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.
pub fn pending_anchor(&self) -> Option<Selection<Anchor>>
pub fn pending<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Option<Selection<D>>
pub fn pending_mode(&self) -> Option<SelectMode>
pub fn all<'a, D>(&self, cx: &AppContext) -> Vec<Selection<D>>where D: 'a + TextDimension + Ord + Sub<D, Output = D> + Debug,
sourcepub fn all_adjusted(&self, cx: &mut AppContext) -> Vec<Selection<Point>>
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
pub fn all_adjusted_display( &self, cx: &mut AppContext ) -> (DisplaySnapshot, Vec<Selection<DisplayPoint>>)
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,
pub fn all_display( &self, cx: &mut AppContext ) -> (DisplaySnapshot, Vec<Selection<DisplayPoint>>)
pub fn newest_anchor(&self) -> &Selection<Anchor>
pub fn newest<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>
pub fn newest_display(&self, cx: &mut AppContext) -> Selection<DisplayPoint>
pub fn oldest_anchor(&self) -> &Selection<Anchor>
pub fn oldest<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>
pub fn first_anchor(&self) -> Selection<Anchor>
pub fn first<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>
pub fn last<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>
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>
impl<'a> Deref for MutableSelectionsCollection<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MutableSelectionsCollection<'a>
impl<'a> !Send for MutableSelectionsCollection<'a>
impl<'a> !Sync for MutableSelectionsCollection<'a>
impl<'a> Unpin for MutableSelectionsCollection<'a>
impl<'a> !UnwindSafe for MutableSelectionsCollection<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more