Unnamed repository; edit this file 'description' to name the repository.
Add tilde expansion for file opening (#782)
* change to helix_core's tilde expansion, from helix-core::path::expand_tilde
Matt W 2021-09-24
parent 2e0803c · commit df55eaa
-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(())
}