on master help sign in
vsplit can now split scratch buffers.
commitadaf861881f042a27c9ffdfce645f97a5fab8242 authorBlaž Hrastnik <blaz@mxxn.io> dateSat 8 May 2021, 15:29 (5 years ago) parent8a949fb
1 file changed+3−7
helix-term/src/commands.rs+3−7
helix-term/src/commands.rs+3−7
@@ -2163,14 +2163,10 @@ pub fn jump_backward(cx: &mut Context) {
21632163//
21642164
21652165pub fn vsplit(cx: &mut Context) {
2166− // TODO: use doc.id directly, this can only split saved files
2167− let path = cx.doc().path().cloned();
2166+ use helix_view::editor::Action;
2167+ let id = cx.doc().id();
21682168
2169− if let Some(path) = path {
2170− // open the same file again. this will vsplit
2171− cx.editor
2172− .open(path, helix_view::editor::Action::VerticalSplit);
2173− }
2169+ cx.editor.switch(id, Action::VerticalSplit);
21742170}
21752171
21762172pub fn space_mode(cx: &mut Context) {