Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/lib.rs')
-rw-r--r--helix-term/src/lib.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/helix-term/src/lib.rs b/helix-term/src/lib.rs
index 75b67479..71fb3b4f 100644
--- a/helix-term/src/lib.rs
+++ b/helix-term/src/lib.rs
@@ -18,7 +18,6 @@ use futures_util::Future;
mod handlers;
use ignore::DirEntry;
-use url::Url;
#[cfg(windows)]
fn true_color() -> bool {
@@ -63,20 +62,21 @@ fn filter_picker_entry(entry: &DirEntry, root: &Path, dedup_symlinks: bool) -> b
.path()
.canonicalize()
.ok()
- .is_some_and(|path| !path.starts_with(root));
+ .map_or(false, |path| !path.starts_with(root));
}
true
}
/// Opens URL in external program.
-fn open_external_url_callback(
- url: Url,
+fn open_external_url_callback<U: AsRef<std::ffi::OsStr>>(
+ url: U,
) -> impl Future<Output = Result<job::Callback, anyhow::Error>> + Send + 'static {
- let commands = open::commands(url.as_str());
+ let commands = open::commands(url);
async {
for cmd in commands {
- let mut command: tokio::process::Command = cmd.into();
+ let mut command = tokio::process::Command::new(cmd.get_program());
+ command.args(cmd.get_args());
if command.output().await.is_ok() {
return Ok(job::Callback::Editor(Box::new(|_| {})));
}