Struct liner::Buffer
[−]
[src]
pub struct Buffer { /* fields omitted */ }
A buffer for text in the line editor.
It keeps track of each action performed on it for use with undo/redo.
Methods
impl Buffer
[src]
fn new() -> Self
[src]
fn clear_actions(&mut self)
[src]
fn start_undo_group(&mut self)
[src]
fn end_undo_group(&mut self)
[src]
fn undo(&mut self) -> bool
[src]
fn redo(&mut self) -> bool
[src]
fn revert(&mut self) -> bool
[src]
fn last_arg(&self) -> Option<&[char]>
[src]
fn num_chars(&self) -> usize
[src]
fn num_bytes(&self) -> usize
[src]
fn char_before(&self, cursor: usize) -> Option<char>
[src]
fn char_after(&self, cursor: usize) -> Option<char>
[src]
fn remove(&mut self, start: usize, end: usize) -> usize
[src]
Returns the number of characters removed.
fn insert(&mut self, start: usize, text: &[char])
[src]
fn insert_from_buffer(&mut self, other: &Buffer)
[src]
fn range(&self, start: usize, end: usize) -> String
[src]
fn range_chars(&self, start: usize, end: usize) -> Vec<char>
[src]
fn width(&self) -> Vec<usize>
[src]
fn range_width(&self, start: usize, end: usize) -> Vec<usize>
[src]
fn lines(&self) -> Vec<String>
[src]
fn chars(&self) -> Iter<char>
[src]
fn truncate(&mut self, num: usize)
[src]
fn print<W>(&self, out: &mut W) -> Result<()> where
W: Write,
[src]
W: Write,
fn as_bytes(&self) -> Vec<u8>
[src]
fn print_rest<W>(&self, out: &mut W, after: usize) -> Result<usize> where
W: Write,
[src]
W: Write,
Takes other buffer, measures its length and prints this buffer from the point where the other stopped. Used to implement autosuggestions.
fn starts_with(&self, other: &Buffer) -> bool
[src]
Check if the other buffer starts with the same content as this one. Used to implement autosuggestions.
fn is_empty(&self) -> bool
[src]
Return true if the buffer is empty.
Trait Implementations
impl Debug for Buffer
[src]
impl Clone for Buffer
[src]
fn clone(&self) -> Buffer
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<String> for Buffer
[src]
impl<'a> From<&'a str> for Buffer
[src]
impl Display for Buffer
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl FromIterator<char> for Buffer
[src]
fn from_iter<T: IntoIterator<Item = char>>(t: T) -> Self
[src]
Creates a value from an iterator. Read more