pub struct Editor { /* private fields */ }Expand description
Stateful editor executing changes to the underlying LineBuffer
In comparison to the state-less LineBuffer the Editor keeps track of
the undo/redo history and has facilities for cut/copy/yank/paste
Implementations§
Source§impl Editor
impl Editor
Sourcepub const fn line_buffer(&self) -> &LineBuffer
pub const fn line_buffer(&self) -> &LineBuffer
Get the current LineBuffer
Sourcepub fn get_buffer(&self) -> &str
pub fn get_buffer(&self) -> &str
Get the text of the current LineBuffer
Sourcepub fn edit_buffer<F>(&mut self, func: F, undo_behavior: UndoBehavior)where
F: FnOnce(&mut LineBuffer),
pub fn edit_buffer<F>(&mut self, func: F, undo_behavior: UndoBehavior)where
F: FnOnce(&mut LineBuffer),
Edit the LineBuffer in an undo-safe manner.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Editor
impl !RefUnwindSafe for Editor
impl Send for Editor
impl !Sync for Editor
impl Unpin for Editor
impl !UnwindSafe for Editor
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more