Commit 03696cc4 authored by Martin Sehnoutka's avatar Martin Sehnoutka

Improve delete_all_before_cursor implementation.

parent ccf70091
......@@ -481,9 +481,8 @@ impl<'a, W: TermWrite + Write> Editor<'a, W> {
/// Deletes every character preceding the cursor until the beggining of the line
pub fn delete_all_before_cursor(&mut self) -> io::Result<()> {
while self.cursor > 0 {
self.delete_before_cursor();
}
cur_buf_mut!(self).remove(0, self.cursor);
self.cursor = 0;
self.print_current_buffer(false)
}
......
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