@@ -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) {