From 6c9541148873ff5350bf082ace3b04f2efe52dcd Mon Sep 17 00:00:00 2001 From: iobtl <59901837+iobtl@users.noreply.github.com> Date: Fri, 30 Dec 2022 00:13:06 +0800 Subject: [PATCH] Expand `~` when parsing file paths in `:open` (#5329) --- helix-term/src/commands/typed.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index c2ca1a478..5c0cd6543 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -65,6 +65,7 @@ fn open(cx: &mut compositor::Context, args: &[Cow], event: PromptEvent) -> ensure!(!args.is_empty(), "wrong argument count"); for arg in args { let (path, pos) = args::parse_file(arg); + let path = helix_core::path::expand_tilde(&path); // If the path is a directory, open a file picker on that directory and update the status // message if let Ok(true) = std::fs::canonicalize(&path).map(|p| p.is_dir()) {