Skip to content

Commit a2bbd29

Browse files
committed
feat: custom search engine Lua API (#2452)
1 parent dc46e90 commit a2bbd29

File tree

26 files changed

+216
-119
lines changed

26 files changed

+216
-119
lines changed

Diff for: Cargo.lock

+17-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: yazi-adapter/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-adapter"
3-
version = "25.3.2"
3+
version = "25.3.7"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,9 +9,9 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-config = { path = "../yazi-config", version = "25.3.2" }
13-
yazi-macro = { path = "../yazi-macro", version = "25.3.2" }
14-
yazi-shared = { path = "../yazi-shared", version = "25.3.2" }
12+
yazi-config = { path = "../yazi-config", version = "25.3.7" }
13+
yazi-macro = { path = "../yazi-macro", version = "25.3.7" }
14+
yazi-shared = { path = "../yazi-shared", version = "25.3.7" }
1515

1616
# External dependencies
1717
ansi-to-tui = { workspace = true }

Diff for: yazi-boot/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-boot"
3-
version = "25.3.2"
3+
version = "25.3.7"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,11 +9,11 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-adapter = { path = "../yazi-adapter", version = "25.3.2" }
13-
yazi-config = { path = "../yazi-config", version = "25.3.2" }
14-
yazi-fs = { path = "../yazi-fs", version = "25.3.2" }
15-
yazi-macro = { path = "../yazi-macro", version = "25.3.2" }
16-
yazi-shared = { path = "../yazi-shared", version = "25.3.2" }
12+
yazi-adapter = { path = "../yazi-adapter", version = "25.3.7" }
13+
yazi-config = { path = "../yazi-config", version = "25.3.7" }
14+
yazi-fs = { path = "../yazi-fs", version = "25.3.7" }
15+
yazi-macro = { path = "../yazi-macro", version = "25.3.7" }
16+
yazi-shared = { path = "../yazi-shared", version = "25.3.7" }
1717

1818
# External dependencies
1919
clap = { workspace = true }

Diff for: yazi-cli/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-cli"
3-
version = "25.3.2"
3+
version = "25.3.7"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,11 +9,11 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-boot = { path = "../yazi-boot", version = "25.3.2" }
13-
yazi-dds = { path = "../yazi-dds", version = "25.3.2" }
14-
yazi-fs = { path = "../yazi-fs", version = "25.3.2" }
15-
yazi-macro = { path = "../yazi-macro", version = "25.3.2" }
16-
yazi-shared = { path = "../yazi-shared", version = "25.3.2" }
12+
yazi-boot = { path = "../yazi-boot", version = "25.3.7" }
13+
yazi-dds = { path = "../yazi-dds", version = "25.3.7" }
14+
yazi-fs = { path = "../yazi-fs", version = "25.3.7" }
15+
yazi-macro = { path = "../yazi-macro", version = "25.3.7" }
16+
yazi-shared = { path = "../yazi-shared", version = "25.3.7" }
1717

1818
# External dependencies
1919
anyhow = { workspace = true }
@@ -26,7 +26,7 @@ toml = { workspace = true }
2626
twox-hash = { workspace = true }
2727

2828
[build-dependencies]
29-
yazi-shared = { path = "../yazi-shared", version = "25.3.2" }
29+
yazi-shared = { path = "../yazi-shared", version = "25.3.7" }
3030

3131
# External build dependencies
3232
anyhow = { workspace = true }

Diff for: yazi-codegen/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-codegen"
3-
version = "25.3.2"
3+
version = "25.3.7"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]

Diff for: yazi-config/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-config"
3-
version = "25.3.2"
3+
version = "25.3.7"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,9 +9,9 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-fs = { path = "../yazi-fs", version = "25.3.2" }
13-
yazi-macro = { path = "../yazi-macro", version = "25.3.2" }
14-
yazi-shared = { path = "../yazi-shared", version = "25.3.2" }
12+
yazi-fs = { path = "../yazi-fs", version = "25.3.7" }
13+
yazi-macro = { path = "../yazi-macro", version = "25.3.7" }
14+
yazi-shared = { path = "../yazi-shared", version = "25.3.7" }
1515

1616
# External dependencies
1717
anyhow = { workspace = true }

Diff for: yazi-core/Cargo.toml

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-core"
3-
version = "25.3.2"
3+
version = "25.3.7"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,17 +9,17 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-adapter = { path = "../yazi-adapter", version = "25.3.2" }
13-
yazi-boot = { path = "../yazi-boot", version = "25.3.2" }
14-
yazi-codegen = { path = "../yazi-codegen", version = "25.3.2" }
15-
yazi-config = { path = "../yazi-config", version = "25.3.2" }
16-
yazi-dds = { path = "../yazi-dds", version = "25.3.2" }
17-
yazi-fs = { path = "../yazi-fs", version = "25.3.2" }
18-
yazi-macro = { path = "../yazi-macro", version = "25.3.2" }
19-
yazi-plugin = { path = "../yazi-plugin", version = "25.3.2" }
20-
yazi-proxy = { path = "../yazi-proxy", version = "25.3.2" }
21-
yazi-scheduler = { path = "../yazi-scheduler", version = "25.3.2" }
22-
yazi-shared = { path = "../yazi-shared", version = "25.3.2" }
12+
yazi-adapter = { path = "../yazi-adapter", version = "25.3.7" }
13+
yazi-boot = { path = "../yazi-boot", version = "25.3.7" }
14+
yazi-codegen = { path = "../yazi-codegen", version = "25.3.7" }
15+
yazi-config = { path = "../yazi-config", version = "25.3.7" }
16+
yazi-dds = { path = "../yazi-dds", version = "25.3.7" }
17+
yazi-fs = { path = "../yazi-fs", version = "25.3.7" }
18+
yazi-macro = { path = "../yazi-macro", version = "25.3.7" }
19+
yazi-plugin = { path = "../yazi-plugin", version = "25.3.7" }
20+
yazi-proxy = { path = "../yazi-proxy", version = "25.3.7" }
21+
yazi-scheduler = { path = "../yazi-scheduler", version = "25.3.7" }
22+
yazi-shared = { path = "../yazi-shared", version = "25.3.7" }
2323

2424
# External dependencies
2525
anyhow = { workspace = true }

Diff for: yazi-dds/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-dds"
3-
version = "25.3.2"
3+
version = "25.3.7"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -13,10 +13,10 @@ default = [ "vendored-lua" ]
1313
vendored-lua = [ "mlua/vendored" ]
1414

1515
[dependencies]
16-
yazi-boot = { path = "../yazi-boot", version = "25.3.2" }
17-
yazi-fs = { path = "../yazi-fs", version = "25.3.2" }
18-
yazi-macro = { path = "../yazi-macro", version = "25.3.2" }
19-
yazi-shared = { path = "../yazi-shared", version = "25.3.2" }
16+
yazi-boot = { path = "../yazi-boot", version = "25.3.7" }
17+
yazi-fs = { path = "../yazi-fs", version = "25.3.7" }
18+
yazi-macro = { path = "../yazi-macro", version = "25.3.7" }
19+
yazi-shared = { path = "../yazi-shared", version = "25.3.7" }
2020

2121
# External dependencies
2222
anyhow = { workspace = true }

Diff for: yazi-dds/src/sendable.rs

+16-14
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ impl Sendable {
4343
Value::UserData(ud) => {
4444
if let Ok(t) = ud.take::<yazi_shared::url::Url>() {
4545
Data::Url(t)
46+
} else if let Ok(t) = ud.take::<yazi_fs::FilesOp>() {
47+
Data::Any(Box::new(t))
4648
} else if let Ok(t) = ud.take::<super::body::BodyYankIter>() {
4749
Data::Any(Box::new(t))
4850
} else {
@@ -72,13 +74,13 @@ impl Sendable {
7274
Value::Table(tbl)
7375
}
7476
Data::Url(u) => Value::UserData(lua.create_any_userdata(u)?),
75-
Data::Any(a) => {
76-
if let Ok(t) = a.downcast::<super::body::BodyYankIter>() {
77-
Value::UserData(lua.create_userdata(*t)?)
78-
} else {
79-
Err("unsupported userdata included".into_lua_err())?
80-
}
81-
}
77+
Data::Any(a) => Value::UserData(if a.is::<yazi_fs::FilesOp>() {
78+
lua.create_any_userdata(*a.downcast::<yazi_fs::FilesOp>().unwrap())?
79+
} else if a.is::<super::body::BodyYankIter>() {
80+
lua.create_userdata(*a.downcast::<super::body::BodyYankIter>().unwrap())?
81+
} else {
82+
Err("unsupported userdata included".into_lua_err())?
83+
}),
8284
data => Self::data_to_value_ref(lua, &data)?,
8385
})
8486
}
@@ -107,13 +109,13 @@ impl Sendable {
107109
}
108110
Data::Url(u) => Value::UserData(lua.create_any_userdata(u.clone())?),
109111
Data::Bytes(b) => Value::String(lua.create_string(b)?),
110-
Data::Any(a) => {
111-
if let Some(t) = a.downcast_ref::<super::body::BodyYankIter>() {
112-
Value::UserData(lua.create_userdata(t.clone())?)
113-
} else {
114-
Err("unsupported userdata included".into_lua_err())?
115-
}
116-
}
112+
Data::Any(a) => Value::UserData(if let Some(t) = a.downcast_ref::<yazi_fs::FilesOp>() {
113+
lua.create_any_userdata(t.clone())?
114+
} else if let Some(t) = a.downcast_ref::<super::body::BodyYankIter>() {
115+
lua.create_userdata(t.clone())?
116+
} else {
117+
Err("unsupported userdata included".into_lua_err())?
118+
}),
117119
})
118120
}
119121

Diff for: yazi-ffi/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yazi-ffi"
3-
version = "25.3.2"
3+
version = "25.3.7"
44
edition = "2021"
55
license = "MIT"
66
authors = [ "sxyazi <[email protected]>" ]
@@ -9,7 +9,7 @@ homepage = "https://yazi-rs.github.io"
99
repository = "https://github.com/sxyazi/yazi"
1010

1111
[dependencies]
12-
yazi-macro = { path = "../yazi-macro", version = "25.3.2" }
12+
yazi-macro = { path = "../yazi-macro", version = "25.3.7" }
1313

1414
# External dependencies
1515
anyhow = { workspace = true }

0 commit comments

Comments
 (0)