mirror of https://github.com/helix-editor/helix
Expand `~` when parsing file paths in `:open` (#5329)
parent
9d15b85209
commit
6c95411488
|
@ -65,6 +65,7 @@ fn open(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
|
||||||
ensure!(!args.is_empty(), "wrong argument count");
|
ensure!(!args.is_empty(), "wrong argument count");
|
||||||
for arg in args {
|
for arg in args {
|
||||||
let (path, pos) = args::parse_file(arg);
|
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
|
// If the path is a directory, open a file picker on that directory and update the status
|
||||||
// message
|
// message
|
||||||
if let Ok(true) = std::fs::canonicalize(&path).map(|p| p.is_dir()) {
|
if let Ok(true) = std::fs::canonicalize(&path).map(|p| p.is_dir()) {
|
||||||
|
|
Loading…
Reference in New Issue