Skip to content

Commit 43473db

Browse files
committed
feat!: support passing arguments to previewer/preloader/spotter/fetcher (#1966)
1 parent 37292ad commit 43473db

File tree

54 files changed

+631
-438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+631
-438
lines changed

Cargo.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ crossterm = { version = "0.28.1", features = [ "event-stream" ] }
1919
dirs = "5.0.1"
2020
futures = "0.3.31"
2121
globset = "0.4.15"
22-
libc = "0.2.164"
22+
libc = "0.2.166"
2323
md-5 = "0.10.6"
2424
mlua = { version = "0.10.1", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] }
2525
parking_lot = "0.12.3"
@@ -32,6 +32,6 @@ shell-words = "1.1.0"
3232
tokio = { version = "1.41.1", features = [ "full" ] }
3333
tokio-stream = "0.1.16"
3434
tokio-util = "0.7.12"
35-
tracing = { version = "0.1.40", features = [ "max_level_debug", "release_max_level_debug" ] }
35+
tracing = { version = "0.1.41", features = [ "max_level_debug", "release_max_level_debug" ] }
3636
unicode-width = "0.2.0"
3737
uzers = "0.12.1"

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ https://github.com/sxyazi/yazi/assets/17523360/92ff23fa-0cd5-4f04-b387-894c12265
5757
| [Tabby](https://github.com/Eugeny/tabby) | [Inline images protocol][iip] | ✅ Built-in |
5858
| [VSCode](https://github.com/microsoft/vscode) | [Inline images protocol][iip] | ✅ Built-in |
5959
| [Rio](https://github.com/raphamorim/rio) | [Inline images protocol][iip] | ❌ Rio doesn't correctly clear images (#1786) |
60-
| [Mintty](https://github.com/mintty/mintty) (Git Bash) | [Inline images protocol][iip] | ✅ Built-in |
6160
| [Black Box](https://gitlab.gnome.org/raggesilver/blackbox) | [Sixel graphics format][sixel] | ✅ Built-in |
6261
| [Hyper](https://github.com/vercel/hyper) | [Inline images protocol][iip] | ✅ Built-in |
6362
| X11 / Wayland | Window system protocol | ☑️ [Überzug++][ueberzug] required |

yazi-boot/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ clap = { workspace = true }
2424
clap_complete = "4.5.38"
2525
clap_complete_fig = "4.5.2"
2626
clap_complete_nushell = "4.5.4"
27-
vergen-gitcl = { version = "1.0.1", features = [ "build", "rustc" ] }
27+
vergen-gitcl = { version = "1.0.2", features = [ "build", "rustc" ] }

yazi-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ clap_complete = "4.5.38"
3131
clap_complete_fig = "4.5.2"
3232
clap_complete_nushell = "4.5.4"
3333
serde_json = { workspace = true }
34-
vergen-gitcl = { version = "1.0.1", features = [ "build" ] }
34+
vergen-gitcl = { version = "1.0.2", features = [ "build" ] }
3535

3636
[target.'cfg(target_os = "macos")'.dependencies]
3737
crossterm = { workspace = true, features = [ "use-dev-tty", "libc" ] }

yazi-config/src/keymap/cow.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::VecDeque, ops::Deref};
1+
use std::ops::Deref;
22

33
use yazi_shared::event::CmdCow;
44

@@ -34,10 +34,10 @@ impl Default for ChordCow {
3434
}
3535

3636
impl ChordCow {
37-
pub fn into_seq(self) -> VecDeque<CmdCow> {
37+
pub fn into_seq(self) -> Vec<CmdCow> {
3838
match self {
39-
Self::Owned(c) => c.run.into_iter().map(|c| c.into()).collect(),
40-
Self::Borrowed(c) => c.run.iter().map(|c| c.into()).collect(),
39+
Self::Owned(c) => c.run.into_iter().rev().map(|c| c.into()).collect(),
40+
Self::Borrowed(c) => c.run.iter().rev().map(|c| c.into()).collect(),
4141
}
4242
}
4343
}

yazi-config/src/plugin/fetcher.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,3 @@ impl Fetcher {
2828
|| self.name.as_ref().is_some_and(|p| p.match_path(path, mime == MIME_DIR)))
2929
}
3030
}
31-
32-
#[derive(Debug, Clone)]
33-
pub struct FetcherProps {
34-
pub id: u8,
35-
pub name: &'static str,
36-
pub prio: Priority,
37-
}
38-
39-
impl From<&'static Fetcher> for FetcherProps {
40-
fn from(fetcher: &'static Fetcher) -> Self {
41-
Self { id: fetcher.idx, name: &fetcher.run.name, prio: fetcher.prio }
42-
}
43-
}

yazi-config/src/plugin/preloader.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,3 @@ impl Preloader {
2626
|| self.name.as_ref().is_some_and(|p| p.match_path(path, mime == MIME_DIR))
2727
}
2828
}
29-
30-
#[derive(Debug, Clone)]
31-
pub struct PreloaderProps {
32-
pub id: u8,
33-
pub name: &'static str,
34-
pub prio: Priority,
35-
}
36-
37-
impl From<&'static Preloader> for PreloaderProps {
38-
fn from(preloader: &'static Preloader) -> Self {
39-
Self { id: preloader.idx, name: &preloader.run.name, prio: preloader.prio }
40-
}
41-
}

yazi-core/src/manager/commands/open.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use yazi_fs::Folder;
77
use yazi_macro::emit;
88
use yazi_plugin::isolate;
99
use yazi_proxy::{ManagerProxy, TasksProxy, options::OpenDoOpt};
10-
use yazi_shared::{MIME_DIR, event::{CmdCow, EventQuit}, fs::{File, Url}};
10+
use yazi_shared::{MIME_DIR, event::{Cmd, CmdCow, EventQuit}, fs::{File, Url}};
1111

1212
use crate::{manager::Manager, tasks::Tasks};
1313

@@ -65,7 +65,7 @@ impl Manager {
6565
}
6666

6767
done.extend(files.iter().map(|f| (f.url_owned(), String::new())));
68-
if let Err(e) = isolate::fetch("mime", files).await {
68+
if let Err(e) = isolate::fetch(Cmd::new("mime").into(), files).await {
6969
error!("Fetch `mime` failed in opening: {e}");
7070
}
7171

yazi-core/src/manager/commands/update_mimes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::HashMap;
1+
use std::{borrow::Cow, collections::HashMap};
22

33
use tracing::error;
44
use yazi_macro::render;
@@ -7,7 +7,7 @@ use yazi_shared::{event::CmdCow, fs::Url};
77
use crate::{manager::{LINKED, Manager}, tasks::Tasks};
88

99
pub struct Opt {
10-
updates: HashMap<String, String>,
10+
updates: HashMap<Cow<'static, str>, String>,
1111
}
1212

1313
impl TryFrom<CmdCow> for Opt {
@@ -28,7 +28,7 @@ impl Manager {
2828
let updates = opt
2929
.updates
3030
.into_iter()
31-
.map(|(url, mime)| (Url::from(url), mime))
31+
.map(|(url, mime)| (Url::from(url.into_owned()), mime))
3232
.filter(|(url, mime)| self.mimetype.get(url) != Some(mime))
3333
.fold(HashMap::new(), |mut map, (u, m)| {
3434
for u in linked.from_file(&u) {

0 commit comments

Comments
 (0)