diff options
| author | Don Williams <Don.e.williams@gmail.com> | 2026-08-15 17:44:53 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:34 -0700 |
| commit | e60c28e36ccb3178d4a4573d4c75dc4f0bda6f9e (patch) | |
| tree | 4bf27500a41a5e001225d9ffaf6f1a14bf44bf6e /config/yazi/plugins/yatline.yazi/main.lua | |
| parent | 845e801b873bf995cd7750edee136f9ce3c660e5 (diff) | |
Upd `main.lua` updated depreciated API calls
Signed-off-by: Don Williams <Don.e.williams@gmail.com>
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
Diffstat (limited to 'config/yazi/plugins/yatline.yazi/main.lua')
| -rw-r--r-- | config/yazi/plugins/yatline.yazi/main.lua | 23 |
1 files changed, 16 insertions, 7 deletions
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 |
