on master help sign in
Correct the naming issue with vsplit and hsplit being swapped.
8b33ba2Blaž Hrastnik
helix-term/src/application.rs+2−2
@@ -52,10 +52,10 @@ impl Application {
52
52
53 if let Ok(files) = args.values_of_t::<PathBuf>("files") {
53 if let Ok(files) = args.values_of_t::<PathBuf>("files") {
54 for file in files {
54 for file in files {
55− editor.open(file, Action::HorizontalSplit)?;
55+ editor.open(file, Action::VerticalSplit)?;
56 }
56 }
57 } else {
57 } else {
58− editor.new_file(Action::HorizontalSplit)?;
58+ editor.new_file(Action::VerticalSplit)?;
59 }
59 }
60
60
61 compositor.push(Box::new(ui::EditorView::new()));
61 compositor.push(Box::new(ui::EditorView::new()));
helix-term/src/commands.rs+1−1
@@ -1854,7 +1854,7 @@ pub fn vsplit(cx: &mut Context) {
1854 if let Some(path) = path {
1854 if let Some(path) = path {
1855 // open the same file again. this will vsplit
1855 // open the same file again. this will vsplit
1856 cx.editor
1856 cx.editor
1857− .open(path, helix_view::editor::Action::HorizontalSplit);
1857+ .open(path, helix_view::editor::Action::VerticalSplit);
1858 }
1858 }
1859}
1859}
1860
1860
helix-term/src/ui/picker.rs+2−2
@@ -168,7 +168,7 @@ impl<T: 'static> Component for Picker<T> {
168 modifiers: KeyModifiers::CONTROL,
168 modifiers: KeyModifiers::CONTROL,
169 } => {
169 } => {
170 if let Some(option) = self.selection() {
170 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);
172 }
172 }
173 return close_fn;
173 return close_fn;
174 }
174 }
@@ -177,7 +177,7 @@ impl<T: 'static> Component for Picker<T> {
177 modifiers: KeyModifiers::CONTROL,
177 modifiers: KeyModifiers::CONTROL,
178 } => {
178 } => {
179 if let Some(option) = self.selection() {
179 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);
181 }
181 }
182 return close_fn;
182 return close_fn;
183 }
183 }
helix-view/src/tree.rs+4−4
@@ -70,13 +70,13 @@ impl Container {
70
70
71impl Default for Container {
71impl Default for Container {
72 fn default() -> Self {
72 fn default() -> Self {
73− Self::new(Layout::Horizontal)
73+ Self::new(Layout::Vertical)
74 }
74 }
75}
75}
76
76
77impl Tree {
77impl Tree {
78 pub fn new(area: Rect) -> Self {
78 pub fn new(area: Rect) -> Self {
79− let root = Node::container(Layout::Horizontal);
79+ let root = Node::container(Layout::Vertical);
80
80
81 let mut nodes = HopSlotMap::with_key();
81 let mut nodes = HopSlotMap::with_key();
82 let root = nodes.insert(root);
82 let root = nodes.insert(root);
@@ -322,7 +322,7 @@ impl Tree {
322 container.area = area;
322 container.area = area;
323
323
324 match container.layout {
324 match container.layout {
325− Layout::Vertical => {
325+ Layout::Horizontal => {
326 let len = container.children.len();
326 let len = container.children.len();
327
327
328 let height = area.height / len as u16;
328 let height = area.height / len as u16;
@@ -347,7 +347,7 @@ impl Tree {
347 self.stack.push((*child, area));
347 self.stack.push((*child, area));
348 }
348 }
349 }
349 }
350− Layout::Horizontal => {
350+ Layout::Vertical => {
351 let len = container.children.len();
351 let len = container.children.len();
352
352
353 let width = area.width / len as u16;
353 let width = area.width / len as u16;