Commit 6beb7194 authored by Wesley Wiser's avatar Wesley Wiser

Add buffer delete command

parent f6f4c18d
......@@ -62,6 +62,11 @@ impl Editor {
self.buffers.switch_to(new_buffer_index);
self.redraw_task = RedrawTask::Full;
},
"bd" => {
let ix = self.buffers.current_buffer_index();
self.buffers.delete_buffer(ix);
self.redraw_task = RedrawTask::Full;
},
"help" => {
self.open("/apps/sodium/help.txt");
},
......
......@@ -89,6 +89,11 @@ impl BufferManager {
self.buffers.len()
}
/// Gets the index of the current buffer.
pub fn current_buffer_index(&self) -> usize {
self.current_buffer_index
}
/// Get a reference to the currently open buffer.
pub fn current_buffer(&self) -> &SplitBuffer {
&self.current_buffer_info().raw_buffer
......
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