mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-28 12:23:30 +04:00
refactor editor resize functions
This commit is contained in:
parent
e4c90548e1
commit
6891014241
@ -37,7 +37,7 @@
|
||||
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) {
|
||||
|
@ -1645,20 +1645,8 @@ pub fn transpose_view(&mut self) {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user