Commit 003e71aa authored by Matthew Nicholson's avatar Matthew Nicholson
Browse files

add method to Editor for getting a mut ref to the current buffer

parent ff8ab197
......@@ -500,6 +500,12 @@ impl<'a, W: Write> Editor<'a, W> {
cur_buf!(self)
}
/// Returns a mutable reference to the current buffer being edited.
/// This may be the new buffer or a buffer from history.
pub fn current_buffer_mut(&mut self) -> &mut Buffer {
cur_buf_mut!(self)
}
/// Deletes the displayed prompt and buffer, replacing them with the current prompt and buffer
pub fn print_current_buffer(&mut self, move_cursor_to_end_of_line: bool) -> io::Result<()> {
let buf = cur_buf!(self);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment