From db91adf2b4c3ab331e4a92b0c5b4611e52b9d68e Mon Sep 17 00:00:00 2001 From: WindSoilder Date: Thu, 18 Nov 2021 23:25:20 +0800 Subject: [PATCH] fix hsplit and vsplit with parameter --- helix-term/src/commands.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index e1120ef1eeca..f9db94ca2451 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2337,10 +2337,12 @@ mod cmd { args: &[&str], _event: PromptEvent, ) -> anyhow::Result<()> { + use helix_core::path::expand_tilde; let id = view!(cx.editor).doc; if let Some(path) = args.get(0) { - cx.editor.open(path.into(), Action::VerticalSplit)?; + cx.editor + .open(expand_tilde(Path::new(path)), Action::VerticalSplit)?; } else { cx.editor.switch(id, Action::VerticalSplit); } @@ -2353,10 +2355,12 @@ mod cmd { args: &[&str], _event: PromptEvent, ) -> anyhow::Result<()> { + use helix_core::path::expand_tilde; let id = view!(cx.editor).doc; if let Some(path) = args.get(0) { - cx.editor.open(path.into(), Action::HorizontalSplit)?; + cx.editor + .open(expand_tilde(Path::new(path)), Action::HorizontalSplit)?; } else { cx.editor.switch(id, Action::HorizontalSplit); }