pub struct MultiCursor { /* private fields */ }Expand description
Multi-cursor engine managing synchronized cursors across the document.
Implementations§
Source§impl MultiCursor
impl MultiCursor
Sourcepub fn from_selections(selections: Vec<Selection>) -> Self
pub fn from_selections(selections: Vec<Selection>) -> Self
Constructs a MultiCursor engine directly from a collection of selections.
Sourcepub fn set_single(&mut self, pos: Position)
pub fn set_single(&mut self, pos: Position)
Clears secondary cursors and sets single active caret.
Sourcepub fn add_selection(&mut self, sel: Selection)
pub fn add_selection(&mut self, sel: Selection)
Appends a new cursor or selection range, automatically normalizing and merging.
Sourcepub fn add_cursor(&mut self, pos: Position)
pub fn add_cursor(&mut self, pos: Position)
Appends a new single-point cursor caret at pos.
Sourcepub fn add_column_cursors(
&mut self,
start_line: usize,
end_line: usize,
col: usize,
)
pub fn add_column_cursors( &mut self, start_line: usize, end_line: usize, col: usize, )
Adds rectangular column block cursors between start_line and end_line at column col.
Sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
Normalizes selections: sorts them in document order and merges any overlapping carets.
Sourcepub fn selections_descending(&self) -> Vec<Selection>
pub fn selections_descending(&self) -> Vec<Selection>
Returns all active selections sorted in descending document order (bottom-to-top, right-to-left).
Trait Implementations§
Source§impl Clone for MultiCursor
impl Clone for MultiCursor
Source§impl Debug for MultiCursor
impl Debug for MultiCursor
Source§impl Default for MultiCursor
impl Default for MultiCursor
impl Eq for MultiCursor
Source§impl PartialEq for MultiCursor
impl PartialEq for MultiCursor
impl StructuralPartialEq for MultiCursor
Auto Trait Implementations§
impl Forget for MultiCursor
impl Freeze for MultiCursor
impl Move for MultiCursor
impl RefUnwindSafe for MultiCursor
impl Send for MultiCursor
impl Sync for MultiCursor
impl Unpin for MultiCursor
impl UnsafeUnpin for MultiCursor
impl UnwindSafe for MultiCursor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.