From 4b1e110209251c7e2f48f8ea0e16a3b87a9ce6d2 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sun, 15 Feb 2026 13:55:23 +0800 Subject: [PATCH] Add changelog --- CHANGELOG.md | 4 +++- yazi-actor/src/lives/preference.rs | 1 + yazi-actor/src/mgr/sort.rs | 1 + yazi-parser/src/mgr/sort.rs | 4 +++- yazi-plugin/src/runtime/runtime.rs | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2e10722..0e036620 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): - Custom tab name ([#3666]) - Allow using `ps.sub()` in `init.lua` directly without a plugin ([#3638]) +- New `sort_fallback` option to control fallback sorting behavior ([#3077]) - New `fs.access()` API to access the filesystem ([#3668]) -- New `relay-notify-push` DDS event to allow custom notification handlers ([#3642]) +- New `relay-notify-push` DDS event to customize notification handlers ([#3642]) - New `ind-app-title` DDS event to customize the app title ([#3684]) - New `fs.unique()` creates a unique file or directory ([#3677]) - New `cx.which` API to access the which component state ([#3617]) @@ -1577,6 +1578,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): [#3038]: https://github.com/sxyazi/yazi/pull/3038 [#3059]: https://github.com/sxyazi/yazi/pull/3059 [#3067]: https://github.com/sxyazi/yazi/pull/3067 +[#3077]: https://github.com/sxyazi/yazi/pull/3077 [#3083]: https://github.com/sxyazi/yazi/pull/3083 [#3084]: https://github.com/sxyazi/yazi/pull/3084 [#3091]: https://github.com/sxyazi/yazi/pull/3091 diff --git a/yazi-actor/src/lives/preference.rs b/yazi-actor/src/lives/preference.rs index f9f29a5c..db96544c 100644 --- a/yazi-actor/src/lives/preference.rs +++ b/yazi-actor/src/lives/preference.rs @@ -46,5 +46,6 @@ impl UserData for Preference { fields.add_field_method_get("sort_reverse", |_, me| Ok(me.sort_reverse)); fields.add_field_method_get("sort_dir_first", |_, me| Ok(me.sort_dir_first)); fields.add_field_method_get("sort_translit", |_, me| Ok(me.sort_translit)); + fields.add_field_method_get("sort_fallback", |_, me| Ok(me.sort_fallback.to_string())); } } diff --git a/yazi-actor/src/mgr/sort.rs b/yazi-actor/src/mgr/sort.rs index 7ad3b322..81b77676 100644 --- a/yazi-actor/src/mgr/sort.rs +++ b/yazi-actor/src/mgr/sort.rs @@ -22,6 +22,7 @@ impl Actor for Sort { pref.sort_dir_first = opt.dir_first.unwrap_or(pref.sort_dir_first); pref.sort_sensitive = opt.sensitive.unwrap_or(pref.sort_sensitive); pref.sort_translit = opt.translit.unwrap_or(pref.sort_translit); + pref.sort_fallback = opt.fallback.unwrap_or(pref.sort_fallback); let sorter = FilesSorter::from(&*pref); let hovered = cx.hovered().map(|f| f.urn().to_owned()); diff --git a/yazi-parser/src/mgr/sort.rs b/yazi-parser/src/mgr/sort.rs index 580ac4f6..5e4295a2 100644 --- a/yazi-parser/src/mgr/sort.rs +++ b/yazi-parser/src/mgr/sort.rs @@ -1,7 +1,7 @@ use mlua::{FromLua, IntoLua, Lua, LuaSerdeExt, Value}; use serde::{Deserialize, Serialize}; use yazi_binding::SER_OPT; -use yazi_fs::SortBy; +use yazi_fs::{SortBy, SortFallback}; use yazi_shared::event::CmdCow; #[derive(Debug, Default, Deserialize, Serialize)] @@ -11,6 +11,7 @@ pub struct SortOpt { pub dir_first: Option, pub sensitive: Option, pub translit: Option, + pub fallback: Option, } impl TryFrom for SortOpt { @@ -23,6 +24,7 @@ impl TryFrom for SortOpt { dir_first: c.get("dir-first").ok(), sensitive: c.get("sensitive").ok(), translit: c.get("translit").ok(), + fallback: c.get("fallback").ok().map(str::parse).transpose()?, }) } } diff --git a/yazi-plugin/src/runtime/runtime.rs b/yazi-plugin/src/runtime/runtime.rs index b040e68b..0724e3e6 100644 --- a/yazi-plugin/src/runtime/runtime.rs +++ b/yazi-plugin/src/runtime/runtime.rs @@ -48,6 +48,7 @@ fn mgr() -> Composer { b"sort_reverse" => m.sort_reverse.get().into_lua(lua)?, b"sort_dir_first" => m.sort_dir_first.get().into_lua(lua)?, b"sort_translit" => m.sort_translit.get().into_lua(lua)?, + b"sort_fallback" => lua.to_value_with(&m.sort_fallback, SER_OPT)?, b"linemode" => lua.create_string(&m.linemode)?.into_lua(lua)?, b"show_hidden" => m.show_hidden.get().into_lua(lua)?,