on master help sign in
Correct the naming issue with vsplit and hsplit being swapped.
commit8b33ba2284f88bea4c6144364d75189255466661 authorBlaž Hrastnik <blaz@mxxn.io> dateThu 8 Apr 2021, 15:52 (6 years ago) parent58c5fec
4 files changed+9−9
helix-term/src/application.rs+2−2 helix-term/src/commands.rs+1−1 helix-term/src/ui/picker.rs+2−2 helix-view/src/tree.rs+4−4
helix-term/src/application.rs+2−2
@@ -52,10 +52,10 @@ impl Application {
5252
5353 if let Ok(files) = args.values_of_t::<PathBuf>("files") {
5454 for file in files {
55− editor.open(file, Action::HorizontalSplit)?;
55+ editor.open(file, Action::VerticalSplit)?;
5656 }
5757 } else {
58− editor.new_file(Action::HorizontalSplit)?;
58+ editor.new_file(Action::VerticalSplit)?;
5959 }
6060
6161 compositor.push(Box::new(ui::EditorView::new()));
helix-term/src/commands.rs+1−1
@@ -1854,7 +1854,7 @@ pub fn vsplit(cx: &mut Context) {
18541854 if let Some(path) = path {
18551855 // open the same file again. this will vsplit
18561856 cx.editor
1857− .open(path, helix_view::editor::Action::HorizontalSplit);
1857+ .open(path, helix_view::editor::Action::VerticalSplit);
18581858 }
18591859}
18601860
helix-term/src/ui/picker.rs+2−2
@@ -168,7 +168,7 @@ impl<T: 'static> Component for Picker<T> {
168168 modifiers: KeyModifiers::CONTROL,
169169 } => {
170170 if let Some(option) = self.selection() {
171− (self.callback_fn)(&mut cx.editor, option, Action::VerticalSplit);
171+ (self.callback_fn)(&mut cx.editor, option, Action::HorizontalSplit);
172172 }
173173 return close_fn;
174174 }
@@ -177,7 +177,7 @@ impl<T: 'static> Component for Picker<T> {
177177 modifiers: KeyModifiers::CONTROL,
178178 } => {
179179 if let Some(option) = self.selection() {
180− (self.callback_fn)(&mut cx.editor, option, Action::HorizontalSplit);
180+ (self.callback_fn)(&mut cx.editor, option, Action::VerticalSplit);
181181 }
182182 return close_fn;
183183 }
helix-view/src/tree.rs+4−4
@@ -70,13 +70,13 @@ impl Container {
7070
7171impl Default for Container {
7272 fn default() -> Self {
73− Self::new(Layout::Horizontal)
73+ Self::new(Layout::Vertical)
7474 }
7575}
7676
7777impl Tree {
7878 pub fn new(area: Rect) -> Self {
79− let root = Node::container(Layout::Horizontal);
79+ let root = Node::container(Layout::Vertical);
8080
8181 let mut nodes = HopSlotMap::with_key();
8282 let root = nodes.insert(root);
@@ -322,7 +322,7 @@ impl Tree {
322322 container.area = area;
323323
324324 match container.layout {
325− Layout::Vertical => {
325+ Layout::Horizontal => {
326326 let len = container.children.len();
327327
328328 let height = area.height / len as u16;
@@ -347,7 +347,7 @@ impl Tree {
347347 self.stack.push((*child, area));
348348 }
349349 }
350− Layout::Horizontal => {
350+ Layout::Vertical => {
351351 let len = container.children.len();
352352
353353 let width = area.width / len as u16;