From e60c28e36ccb3178d4a4573d4c75dc4f0bda6f9e Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 15 Aug 2026 17:44:53 -0400 Subject: Upd `main.lua` updated depreciated API calls Signed-off-by: Don Williams On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: CHANGELOG.md modified: config/yazi/plugins/yatline.yazi/main.lua new file: config/yazi/plugins/yatline.yazi/main.lua.bak-20260815-174119 --- config/yazi/plugins/yatline.yazi/main.lua | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'config/yazi/plugins/yatline.yazi/main.lua') diff --git a/config/yazi/plugins/yatline.yazi/main.lua b/config/yazi/plugins/yatline.yazi/main.lua index eda7213b..3a0ea58a 100644 --- a/config/yazi/plugins/yatline.yazi/main.lua +++ b/config/yazi/plugins/yatline.yazi/main.lua @@ -625,8 +625,14 @@ function Yatline.string.get:hovered_file_extension(show_icon) end if show_icon then - local icon = hovered:icon().text - return icon .. " " .. name + local matched = th and th.icon and th.icon:match(hovered) + local icon = (matched and matched.text) or "" + + if icon ~= "" then + return icon .. " " .. name + else + return name + end else return name end @@ -648,10 +654,11 @@ function Yatline.string.get:tab_path(trimmed, max_length, trim_length) local cwd = cx.active.current.cwd local filter = cx.active.current.files.filter local finder = cx.active.finder + local spec = cwd and cwd.spec local t = {} - if cwd.is_search then - t[#t + 1] = string.format("search: %s", cwd.domain) + if spec and spec.is_search then + t[#t + 1] = string.format("search: %s", spec.domain or "") end if filter then t[#t + 1] = string.format("filter: %s", filter) @@ -696,9 +703,10 @@ function Yatline.string.get:search_query(key) key = key or "search:" local cwd = cx.active.current.cwd + local spec = cwd and cwd.spec - if cwd.is_search then - return string.format("%s %s", key, cwd.domain) + if spec and spec.is_search then + return string.format("%s %s", key, spec.domain or "") else return "" end @@ -1000,7 +1008,8 @@ function Yatline.coloreds.get:count(filter, zero_check) if filter then local files_count_fg, files_count_icon - if cx.active.current.files.filter or cx.active.current.cwd.is_search then + local cwd_spec = cx.active.current.cwd and cx.active.current.cwd.spec + if cx.active.current.files.filter or (cwd_spec and cwd_spec.is_search) then files_count_fg = Yatline.config.filtereds.fg files_count_icon = Yatline.config.filtereds.icon else -- cgit v1.2.3