pub struct Line { /* private fields */ }Implementations§
Source§impl Line
impl Line
pub fn text(&self) -> String
pub fn is_empty(&self) -> bool
pub fn mode(&self) -> Mode
Sourcepub fn pending(&self) -> String
pub fn pending(&self) -> String
the pending command, echoed in the footer the way vi shows one.
Sourcepub fn accept(&mut self) -> String
pub fn accept(&mut self) -> String
accept the line: record it in history and start a fresh one in insert mode, the way hitting enter in any chat client does.
Sourcepub fn history_rev(&self) -> u32
pub fn history_rev(&self) -> u32
changes every time accept records a line.
Sourcepub fn set_history(&mut self, lines: impl IntoIterator<Item = String>)
pub fn set_history(&mut self, lines: impl IntoIterator<Item = String>)
seed history from disk: blanks and repeats dropped, only the newest
HISTORY_CAP kept.
Sourcepub fn focus(&mut self)
pub fn focus(&mut self)
entering the composer always starts in insert mode — you came here to type, and the draft you left behind is still there.
Sourcepub fn replace_range(&mut self, lo: usize, hi: usize, s: &str)
pub fn replace_range(&mut self, lo: usize, hi: usize, s: &str)
replace lo..hi (char indices) with s, leaving the cursor after the
inserted text. undoable. this is the completion hook: tab swaps the word
under the cursor for a candidate without the editor knowing why.
pub fn key(&mut self, k: KeyEvent) -> Act
Trait Implementations§
Auto Trait Implementations§
impl Forget for Line
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnsafeUnpin for Line
impl UnwindSafe for Line
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