diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index ff906fef5..592ef5260 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -37,7 +37,7 @@ use helix_view::{ info::Info, input::KeyEvent, keyboard::KeyCode, - tree, + tree::{Dimension, Resize}, view::View, Document, DocumentId, Editor, ViewId, }; @@ -773,18 +773,18 @@ fn goto_line_start(cx: &mut Context) { } fn grow_buffer_width(cx: &mut Context) { - cx.editor.grow_buffer_width(); + cx.editor.resize_buffer(Resize::Grow, Dimension::Width); } fn shrink_buffer_width(cx: &mut Context) { - cx.editor.shrink_buffer_width(); + cx.editor.resize_buffer(Resize::Shrink, Dimension::Width); } fn grow_buffer_height(cx: &mut Context) { - cx.editor.grow_buffer_height(); + cx.editor.resize_buffer(Resize::Grow, Dimension::Height); } fn shrink_buffer_height(cx: &mut Context) { - cx.editor.shrink_buffer_height(); + cx.editor.resize_buffer(Resize::Shrink, Dimension::Height); } fn buffer_expand_mode(cx: &mut Context) { diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 03753345c..f118caa8c 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1645,20 +1645,8 @@ impl Editor { self.tree.transpose(); } - pub fn grow_buffer_width(&mut self) { - self.tree.resize_buffer(Resize::Grow, Dimension::Width); - } - - pub fn shrink_buffer_width(&mut self) { - self.tree.resize_buffer(Resize::Shrink, Dimension::Width); - } - - pub fn grow_buffer_height(&mut self) { - self.tree.resize_buffer(Resize::Grow, Dimension::Height); - } - - pub fn shrink_buffer_height(&mut self) { - self.tree.resize_buffer(Resize::Shrink, Dimension::Height); + pub fn resize_buffer(&mut self, resize_type: Resize, dimension: Dimension) { + self.tree.resize_buffer(resize_type, dimension); } pub fn buffer_expand_mode(&mut self) {