pub struct SelectionsCollection {
pub next_selection_id: usize,
pub line_mode: bool,
/* private fields */
}
Fields§
§next_selection_id: usize
§line_mode: bool
Implementations§
source§impl SelectionsCollection
impl SelectionsCollection
pub fn new(display_map: Model<DisplayMap>, buffer: Model<MultiBuffer>) -> Self
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 Clone for SelectionsCollection
impl Clone for SelectionsCollection
source§fn clone(&self) -> SelectionsCollection
fn clone(&self) -> SelectionsCollection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SelectionsCollection
impl Send for SelectionsCollection
impl Sync for SelectionsCollection
impl Unpin for SelectionsCollection
impl !UnwindSafe for SelectionsCollection
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