aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt W2021-09-24 02:21:04 +0000
committerGitHub2021-09-24 02:21:04 +0000
commitdf55eaae69d0388de26448e82f9ded483fca2f44 (patch)
treed36719e30f49fca29506afa7401bb8a7037f0e45
parent2e0803c8d9ec0028c0d018be251c7c2b781247b3 (diff)
Add tilde expansion for file opening (#782)
* change to helix_core's tilde expansion, from helix-core::path::expand_tilde
-rw-r--r--helix-term/src/commands.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 025639a5..26f599bd 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1524,8 +1524,11 @@ mod cmd {
args: &[&str],
_event: PromptEvent,
) -> anyhow::Result<()> {
+ use helix_core::path::expand_tilde;
let path = args.get(0).context("wrong argument count")?;
- let _ = cx.editor.open(path.into(), Action::Replace)?;
+ let _ = cx
+ .editor
+ .open(expand_tilde(Path::new(path)), Action::Replace)?;
Ok(())
}