pub struct Cursor { /* private fields */ }
Expand description
A Cursor
represents a user cursor associated with a text buffer.
Cursor
s consist of a location in a Rope
and optionally a selection and
desired visual offset.
Implementations§
Source§impl Cursor
impl Cursor
pub fn new() -> Self
pub fn with_range(range: Range<CharIndex>) -> Self
pub fn is_empty(&self) -> bool
pub fn range(&self) -> Range<CharIndex>
pub fn selection(&self) -> Range<CharIndex>
pub fn column_offset(&self, tab_width: usize, text: &Rope) -> usize
pub fn reconcile(&mut self, new_text: &Rope, diff: &OpaqueDiff)
pub fn begin_selection(&mut self)
pub fn clear_selection(&mut self)
pub fn select_all(&mut self, text: &Rope)
pub fn insert_char(&mut self, text: &mut Rope, character: char) -> OpaqueDiff
pub fn insert_chars( &mut self, text: &mut Rope, characters: impl IntoIterator<Item = char>, ) -> OpaqueDiff
pub fn delete_forward(&mut self, text: &mut Rope) -> DeleteOperation
pub fn delete_backward(&mut self, text: &mut Rope) -> DeleteOperation
pub fn delete_line(&mut self, text: &mut Rope) -> DeleteOperation
pub fn delete_selection(&mut self, text: &mut Rope) -> DeleteOperation
pub fn sync(&mut self, current_text: &Rope, new_text: &Rope)
Trait Implementations§
impl StructuralPartialEq for Cursor
Auto Trait Implementations§
impl Freeze for Cursor
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnwindSafe for Cursor
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