aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands/typed.rs14
-rw-r--r--helix-term/src/ui/mod.rs4
2 files changed, 9 insertions, 9 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index b7ceeba5..3d7ea3fc 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -110,14 +110,14 @@ fn open(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
ensure!(!args.is_empty(), "wrong argument count");
for arg in args {
let (path, pos) = args::parse_file(arg);
- let path = helix_stdx::path::expand_tilde(&path);
+ let path = helix_stdx::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()) {
let callback = async move {
let call: job::Callback = job::Callback::EditorCompositor(Box::new(
move |editor: &mut Editor, compositor: &mut Compositor| {
- let picker = ui::file_picker(path, &editor.config());
+ let picker = ui::file_picker(path.into_owned(), &editor.config());
compositor.push(Box::new(overlaid(picker)));
},
));
@@ -1078,11 +1078,11 @@ fn change_current_directory(
return Ok(());
}
- let dir = helix_stdx::path::expand_tilde(
- args.first()
- .context("target directory not provided")?
- .as_ref(),
- );
+ let dir = args
+ .first()
+ .context("target directory not provided")?
+ .as_ref();
+ let dir = helix_stdx::path::expand_tilde(Path::new(dir));
helix_stdx::env::set_current_working_dir(dir)?;
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index d27e8355..0873116c 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -428,9 +428,9 @@ pub mod completers {
path
} else {
match path.parent() {
- Some(path) if !path.as_os_str().is_empty() => path.to_path_buf(),
+ Some(path) if !path.as_os_str().is_empty() => Cow::Borrowed(path),
// Path::new("h")'s parent is Some("")...
- _ => helix_stdx::env::current_working_dir(),
+ _ => Cow::Owned(helix_stdx::env::current_working_dir()),
}
};