diff options
author | Blaž Hrastnik | 2021-05-08 06:29:15 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-05-08 06:29:15 +0000 |
commit | adaf861881f042a27c9ffdfce645f97a5fab8242 (patch) | |
tree | a50da47ae55a3b3411f02ef7e02cae6cdd684b55 /helix-term/src | |
parent | 8a949fb0113412f0becaeae68e2fbf61a0ecb532 (diff) |
vsplit can now split scratch buffers.
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index afeb291d..65d286d9 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2163,14 +2163,10 @@ pub fn jump_backward(cx: &mut Context) { // pub fn vsplit(cx: &mut Context) { - // TODO: use doc.id directly, this can only split saved files - let path = cx.doc().path().cloned(); + use helix_view::editor::Action; + let id = cx.doc().id(); - if let Some(path) = path { - // open the same file again. this will vsplit - cx.editor - .open(path, helix_view::editor::Action::VerticalSplit); - } + cx.editor.switch(id, Action::VerticalSplit); } pub fn space_mode(cx: &mut Context) { |