diff --git a/yazi-config/preset/theme-dark.toml b/yazi-config/preset/theme-dark.toml index 90d6eca6..9891a12c 100644 --- a/yazi-config/preset/theme-dark.toml +++ b/yazi-config/preset/theme-dark.toml @@ -28,6 +28,7 @@ overall = {} [mgr] cwd = { fg = "cyan" } +filter_keyword = { fg = "red", bold = true } # Find find_keyword = { fg = "yellow", bold = true, italic = true, underline = true } diff --git a/yazi-config/preset/theme-light.toml b/yazi-config/preset/theme-light.toml index 43cf9552..44bbe12a 100644 --- a/yazi-config/preset/theme-light.toml +++ b/yazi-config/preset/theme-light.toml @@ -28,6 +28,7 @@ overall = {} [mgr] cwd = { fg = "cyan" } +filter_keyword = { fg = "red", bold = true } # Find find_keyword = { fg = "yellow", bold = true, italic = true, underline = true } diff --git a/yazi-config/src/theme/theme.rs b/yazi-config/src/theme/theme.rs index 4998eae1..2adb34fd 100644 --- a/yazi-config/src/theme/theme.rs +++ b/yazi-config/src/theme/theme.rs @@ -71,6 +71,9 @@ pub struct Mgr { pub find_keyword: SyncCell, pub find_position: SyncCell, + // Filter + pub filter_keyword: SyncCell, + // Symlink pub symlink_target: SyncCell, diff --git a/yazi-plugin/preset/components/header.lua b/yazi-plugin/preset/components/header.lua index 494d06a4..394bd224 100644 --- a/yazi-plugin/preset/components/header.lua +++ b/yazi-plugin/preset/components/header.lua @@ -27,8 +27,14 @@ function Header:cwd() return "" end - local s = ya.readable_path(tostring(self._current.cwd)) .. self:flags() - return ui.Span(ui.truncate(s, { max = max, rtl = true })):style(th.mgr.cwd) + local path = ya.readable_path(tostring(self._current.cwd)) + local flags = self:flags() + local flag_str = #flags == 0 and "" or " (" .. table.concat(flags, ", ") .. ")" + + return ui.Line { + ui.Span(ui.truncate(path, { max = max - #flag_str, rtl = true })):style(th.mgr.cwd), + ui.Span(flag_str):style(th.mgr.filter_keyword), + } end function Header:flags() @@ -46,7 +52,7 @@ function Header:flags() if finder then t[#t + 1] = string.format("find: %s", finder) end - return #t == 0 and "" or " (" .. table.concat(t, ", ") .. ")" + return t end function Header:count() diff --git a/yazi-plugin/src/theme/theme.rs b/yazi-plugin/src/theme/theme.rs index 8460b169..aeffe051 100644 --- a/yazi-plugin/src/theme/theme.rs +++ b/yazi-plugin/src/theme/theme.rs @@ -59,6 +59,8 @@ fn mgr() -> Composer { b"find_keyword" => Style::from(&m.find_keyword).into_lua(lua), b"find_position" => Style::from(&m.find_position).into_lua(lua), + b"filter_keyword" => Style::from(&m.filter_keyword).into_lua(lua), + b"symlink_target" => Style::from(&m.symlink_target).into_lua(lua), b"marker_copied" => Style::from(&m.marker_copied).into_lua(lua),