diff --git a/README.md b/README.md index 5e7b5809..683bf737 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Yazi (means "duck") is a terminal file manager written in Rust, based on non-blo - 🧰 Integration with ripgrep, fd, fzf, zoxide - 💫 Vim-like input/pick/confirm/which/notify component, auto-completion for cd paths - 🏷️ Multi-Tab Support, Cross-directory selection, Scrollable Preview (for videos, PDFs, archives, code, directories, etc.) -- 🔄 Bulk Renaming, Visual Mode, File Chooser, [Git Integration](https://github.com/yazi-rs/plugins/tree/main/git.yazi), [Mount Manager](https://github.com/yazi-rs/plugins/tree/main/mount.yazi) +- 🔄 Bulk Renaming, Archive Extraction, Visual Mode, File Chooser, [Git Integration](https://github.com/yazi-rs/plugins/tree/main/git.yazi), [Mount Manager](https://github.com/yazi-rs/plugins/tree/main/mount.yazi) - 🎨 Theme System, Mouse Support, Trash Bin, Custom Layouts, CSI u, OSC 52 - ... and more! diff --git a/scripts/bump.sh b/scripts/bump.sh index fd698e71..9db4b58b 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -1,7 +1,7 @@ #!/bin/bash set -euo pipefail -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd $SCRIPT_DIR/.. echo "Bumping version: $1" diff --git a/yazi-config/preset/README.md b/yazi-config/preset/README.md index a1528d90..c4a54917 100644 --- a/yazi-config/preset/README.md +++ b/yazi-config/preset/README.md @@ -1,7 +1,7 @@ # Default Configuration > [!IMPORTANT] -> If you're using a stable release of Yazi instead of the latest nightly build, make sure you're checking these files from [the `shipped` tag][shipped], not the latest main branch. +> If you're using a stable release of Yazi instead of the newest nightly build, make sure you're checking these files out from [the `shipped` tag][shipped], not the newest `main` branch. This directory contains the default configuration files for Yazi: diff --git a/yazi-core/src/tasks/commands/inspect.rs b/yazi-core/src/tasks/commands/inspect.rs index f3003e13..78b97771 100644 --- a/yazi-core/src/tasks/commands/inspect.rs +++ b/yazi-core/src/tasks/commands/inspect.rs @@ -32,6 +32,7 @@ impl Tasks { terminal_clear(TTY.writer()).ok(); TTY.writer().write_all(buffered.as_bytes()).ok(); + TTY.writer().flush().ok(); defer! { disable_raw_mode().ok(); } enable_raw_mode().ok(); diff --git a/yazi-dds/src/sendable.rs b/yazi-dds/src/sendable.rs index a060cab8..6463ed18 100644 --- a/yazi-dds/src/sendable.rs +++ b/yazi-dds/src/sendable.rs @@ -168,19 +168,11 @@ impl Sendable { } pub fn list_to_values(lua: &Lua, data: Vec) -> mlua::Result { - let mut vec = Vec::with_capacity(data.len()); - for v in data { - vec.push(Self::data_to_value(lua, v)?); - } - Ok(MultiValue::from_vec(vec)) + data.into_iter().map(|d| Self::data_to_value(lua, d)).collect() } pub fn values_to_list(values: MultiValue) -> mlua::Result> { - let mut vec = Vec::with_capacity(values.len()); - for value in values { - vec.push(Self::value_to_data(value)?); - } - Ok(vec) + values.into_iter().map(Self::value_to_data).collect() } } diff --git a/yazi-plugin/src/url/url.rs b/yazi-plugin/src/url/url.rs index 23ec448f..9942f7bd 100644 --- a/yazi-plugin/src/url/url.rs +++ b/yazi-plugin/src/url/url.rs @@ -8,6 +8,9 @@ impl Url { pub fn register(lua: &Lua) -> mlua::Result<()> { lua.register_userdata_type::(|reg| { reg.add_method("frag", |lua, me, ()| lua.create_string(me.frag())); + reg.add_field_method_get("base", |_, me| { + Ok(if me.base().as_os_str().is_empty() { None } else { Some(Self::from(me.base())) }) + }); reg.add_field_method_get("is_regular", |_, me| Ok(me.is_regular())); reg.add_field_method_get("is_search", |_, me| Ok(me.is_search())); reg.add_field_method_get("is_archive", |_, me| Ok(me.is_archive())); @@ -15,7 +18,10 @@ impl Url { reg.add_field_method_get("has_root", |_, me| Ok(me.has_root())); reg.add_method("name", |lua, me, ()| { - me.file_name().map(|s| lua.create_string(s.as_encoded_bytes())).transpose() + Some(me.name()) + .filter(|&s| !s.is_empty()) + .map(|s| lua.create_string(s.as_encoded_bytes())) + .transpose() }); reg.add_method("stem", |lua, me, ()| { me.file_stem().map(|s| lua.create_string(s.as_encoded_bytes())).transpose() diff --git a/yazi-plugin/src/utils/sync.rs b/yazi-plugin/src/utils/sync.rs index 64085191..b4ee1232 100644 --- a/yazi-plugin/src/utils/sync.rs +++ b/yazi-plugin/src/utils/sync.rs @@ -91,9 +91,9 @@ impl Utils { let args = [Ok(Value::Table(plugin))] .into_iter() .chain(args.into_iter().map(|d| Sendable::data_to_value(lua, d))) - .collect::>()?; + .collect::>()?; - let values = Sendable::values_to_list(block.call(MultiValue::from_vec(args))?)?; + let values = Sendable::values_to_list(block.call(args)?)?; tx.send(values).map_err(|_| "send failed".into_lua_err()) }) };