pub struct Snapshot {
pub rope: Rope,
pub selections: Selections,
}Expand description
The buffer as it stood before an edit, and where the cursors were.
Storing the selections is what makes undo put the caret back where the edit happened rather than wherever clamping left it. Every editor in the field does this; an undo that leaves the cursor somewhere unrelated is disorienting enough that users stop trusting it.
Fields§
§rope: Rope§selections: SelectionsTrait Implementations§
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
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