From 8b33ba2284f88bea4c6144364d75189255466661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 8 Apr 2021 15:52:04 +0900 Subject: [PATCH] Correct the naming issue with vsplit and hsplit being swapped. --- helix-term/src/application.rs | 4 ++-- helix-term/src/commands.rs | 2 +- helix-term/src/ui/picker.rs | 4 ++-- helix-view/src/tree.rs | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 396bd5650..71c6fba1d 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -52,10 +52,10 @@ pub fn new(mut args: Args, executor: &'static smol::Executor<'static>) -> Result if let Ok(files) = args.values_of_t::("files") { for file in files { - editor.open(file, Action::HorizontalSplit)?; + editor.open(file, Action::VerticalSplit)?; } } else { - editor.new_file(Action::HorizontalSplit)?; + editor.new_file(Action::VerticalSplit)?; } compositor.push(Box::new(ui::EditorView::new())); diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 43dd55b12..2e205fa60 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1854,7 +1854,7 @@ pub fn vsplit(cx: &mut Context) { if let Some(path) = path { // open the same file again. this will vsplit cx.editor - .open(path, helix_view::editor::Action::HorizontalSplit); + .open(path, helix_view::editor::Action::VerticalSplit); } } diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index ef2fe2a86..39580f66f 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -168,7 +168,7 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult { modifiers: KeyModifiers::CONTROL, } => { if let Some(option) = self.selection() { - (self.callback_fn)(&mut cx.editor, option, Action::VerticalSplit); + (self.callback_fn)(&mut cx.editor, option, Action::HorizontalSplit); } return close_fn; } @@ -177,7 +177,7 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult { modifiers: KeyModifiers::CONTROL, } => { if let Some(option) = self.selection() { - (self.callback_fn)(&mut cx.editor, option, Action::HorizontalSplit); + (self.callback_fn)(&mut cx.editor, option, Action::VerticalSplit); } return close_fn; } diff --git a/helix-view/src/tree.rs b/helix-view/src/tree.rs index 5fed2d5a0..6204ba415 100644 --- a/helix-view/src/tree.rs +++ b/helix-view/src/tree.rs @@ -70,13 +70,13 @@ pub fn new(layout: Layout) -> Self { impl Default for Container { fn default() -> Self { - Self::new(Layout::Horizontal) + Self::new(Layout::Vertical) } } impl Tree { pub fn new(area: Rect) -> Self { - let root = Node::container(Layout::Horizontal); + let root = Node::container(Layout::Vertical); let mut nodes = HopSlotMap::with_key(); let root = nodes.insert(root); @@ -322,7 +322,7 @@ pub fn recalculate(&mut self) { container.area = area; match container.layout { - Layout::Vertical => { + Layout::Horizontal => { let len = container.children.len(); let height = area.height / len as u16; @@ -347,7 +347,7 @@ pub fn recalculate(&mut self) { self.stack.push((*child, area)); } } - Layout::Horizontal => { + Layout::Vertical => { let len = container.children.len(); let width = area.width / len as u16;