diff --git a/CHANGELOG.md b/CHANGELOG.md index 28c2366d..aded5892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): ### Fixed +- User-prepended open rules do not override presets ([#3360]) - Respect user's system media opener instead of hardcoding `mpv` ([#2959]) - Incorrect `$0` and `$@` parameters in `shell` command under empty directories ([#3225]) - Avoid appending a newline when reading clipboard contents ([#3059]) @@ -1537,3 +1538,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): [#3290]: https://github.com/sxyazi/yazi/pull/3290 [#3313]: https://github.com/sxyazi/yazi/pull/3313 [#3317]: https://github.com/sxyazi/yazi/pull/3317 +[#3360]: https://github.com/sxyazi/yazi/pull/3360 diff --git a/yazi-config/src/open/open.rs b/yazi-config/src/open/open.rs index 05953e16..731fcda6 100644 --- a/yazi-config/src/open/open.rs +++ b/yazi-config/src/open/open.rs @@ -34,10 +34,11 @@ impl Open { self .rules .iter() - .filter(move |&r| { + .find(move |&r| { r.mime.as_ref().is_some_and(|p| p.match_mime(&mime)) || r.url.as_ref().is_some_and(|p| p.match_url(url.as_url(), is_dir)) }) + .into_iter() .flat_map(|r| &r.r#use) .map(String::as_str) } diff --git a/yazi-scheduler/src/process/shell.rs b/yazi-scheduler/src/process/shell.rs index 73abe147..1b6c704f 100644 --- a/yazi-scheduler/src/process/shell.rs +++ b/yazi-scheduler/src/process/shell.rs @@ -40,9 +40,8 @@ pub(crate) async fn shell(opt: ShellOpt) -> Result { .stderr(opt.stdio()) .arg("-c") .arg(opt.cmd) - // .arg("--") // TODO: remove - .args(opt.args.iter().skip(1).map(|u| u.as_url().unified_path_str())) + .args(opt.args.iter().map(|u| u.as_url().unified_path_str())) .current_dir(cwd) .kill_on_drop(!opt.orphan) .pre_exec(move || {