aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands/typed.rs
diff options
context:
space:
mode:
authorLorenzo Bellina2023-09-04 03:39:48 +0000
committerGitHub2023-09-04 03:39:48 +0000
commite8fc77fe98a79473faacba544acae9e52b36903f (patch)
tree8861b0289ed8eb773651e17b82368233451d4dbc /helix-term/src/commands/typed.rs
parentbb3e6998e641f25f3f73d0805522b451c18ac633 (diff)
Maintain the current cursor's position and view in the vsplit/hsplit commands too (#8109)
Co-authored-by: Benjamin Bouvier <public@benj.me>
Diffstat (limited to 'helix-term/src/commands/typed.rs')
-rw-r--r--helix-term/src/commands/typed.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index 0e1d9431..e38853c0 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -1536,10 +1536,8 @@ fn vsplit(
return Ok(());
}
- let id = view!(cx.editor).doc;
-
if args.is_empty() {
- cx.editor.switch(id, Action::VerticalSplit);
+ split(cx.editor, Action::VerticalSplit);
} else {
for arg in args {
cx.editor
@@ -1559,10 +1557,8 @@ fn hsplit(
return Ok(());
}
- let id = view!(cx.editor).doc;
-
if args.is_empty() {
- cx.editor.switch(id, Action::HorizontalSplit);
+ split(cx.editor, Action::HorizontalSplit);
} else {
for arg in args {
cx.editor