This commit is contained in:
2026-08-18 22:14:00 +02:00
parent 54c310bf9b
commit 06125f5b42
13 changed files with 92 additions and 43 deletions
+7 -7
View File
@@ -1,11 +1,11 @@
[[plugin.deps]]
use = "yazi-rs/plugins:git"
rev = "0be29a9"
hash = "fbb53c3c04f816d737f9f4b1d29f3310"
rev = "6f26ae0"
hash = "ce345e7e8baed03a2561b314fa85e59a"
[[plugin.deps]]
use = "yazi-rs/plugins:smart-enter"
rev = "0be29a9"
rev = "6f26ae0"
hash = "187cc58ba7ac3befd49c342129e6f1b6"
[[plugin.deps]]
@@ -20,13 +20,13 @@ hash = "fbaf0adc8efc59555b748d36aab62d40"
[[plugin.deps]]
use = "llanosrocas/yaziline"
rev = "c975c26"
hash = "f5e051378c7ee472234ed2abdf0252e7"
rev = "029b27d"
hash = "ceeb45e796faf0d9eed10831ffec7701"
[[plugin.deps]]
use = "Rolv-Apneseth/starship"
rev = "159eaba"
hash = "7de446280b1ba8c49ffd86dbc24bbbe6"
rev = "ea92cf4"
hash = "9776f378459072b6c2875eae5addc49d"
[flavor]
deps = []
@@ -1,4 +1,4 @@
--- @since 26.5.6
--- @since 26.8.15
local WINDOWS = ya.target_family() == "windows"
@@ -94,6 +94,15 @@ local function root(cwd)
until not cwd
end
---@type UnstableFetcher
local function retry(job)
return ya.co(function()
for _, file in ipairs(job.files) do
coroutine.yield(file, { retry = true })
end
end)
end
---@param changed Changes
---@return Changes
local function bubble_up(changed)
@@ -217,7 +226,7 @@ local function fetch(_, job)
local repo = root(cwd)
if not repo then
remove(tostring(cwd))
return true
return require("noop"):fetch(job)
end
local paths = {}
@@ -232,7 +241,8 @@ local function fetch(_, job)
:arg(paths)
:output()
if not output then
return true, Err("Cannot spawn `git` command, error: %s", err)
ya.err("Cannot spawn `git` command, error: " .. err)
return require("noop"):fetch(job)
end
local changed, excluded = {}, {}
@@ -259,17 +269,7 @@ local function fetch(_, job)
add(tostring(cwd), repo, changed)
return false
return retry(job)
end
-- TODO: remove
local function fetch_compact(self, job)
if ya.throttle then
fetch(self, job)
return require("noop"):fetch(job)
else
return fetch(self, job)
end
end
return { setup = setup, fetch = fetch_compact }
return { setup = setup, fetch = fetch }
@@ -7,6 +7,6 @@
---@field renamed boolean Whether to include renamed files in the status (or treat them as modified)
-- TODO: move this to `types.yazi` once it's get stable
---@alias UnstableFetcher fun(self: unknown, job: { files: File[] }): boolean, Error?
---@alias UnstableFetcher fun(self: unknown, job: { files: File[] })
---@alias Changes table<string, CODES>
@@ -14,6 +14,18 @@ local save = ya.sync(function(st, outputs)
render()
end)
-- Url.is_regular is deprecated since v26.8.15, Url.spec.is_regular should be used
---@return boolean
local url_is_regular = ya.sync(function(_, path)
local url = Url(path)
if url.spec then
return url.spec.is_regular
end
return url.is_regular
end)
-- Helper function for accessing the `config_file` state variable
---@return string
local get_config_file = ya.sync(function(st)
@@ -48,8 +60,7 @@ return {
-- Check setup args
if args ~= nil then
if args.config_file ~= nil then
local url = Url(args.config_file)
if url.is_regular then
if url_is_regular(args.config_file) then
local config_file = args.config_file
-- Manually replace '~' and '$HOME' at the start of the path with the OS environment variable
@@ -9,7 +9,7 @@ All supported features are listed [here](#features). More presets are available
## Requirements
- yazi version >= [26.5.6](https://github.com/sxyazi/yazi/releases/tag/v26.5.6).
- yazi version >= [26.8.15](https://github.com/sxyazi/yazi/releases/tag/v26.8.15).
- Font with symbol support. For example [Nerd Fonts](https://www.nerdfonts.com/).
## Compatibility
@@ -24,6 +24,7 @@ This setup allows shipping stable versions on time, while giving early access to
| yaziline | yazi |
| :------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------- |
| [v2.5.6](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.6) | [v26.8.15](https://github.com/sxyazi/yazi/releases/tag/v26.8.15) |
| [v2.5.5](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.5) | [v26.5.6](https://github.com/sxyazi/yazi/releases/tag/v26.5.6) |
| [v2.5.4](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.4) | [v26.5.6](https://github.com/sxyazi/yazi/releases/tag/v26.5.6) |
| [v2.5.3](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.3) | [v26.1.22](https://github.com/sxyazi/yazi/releases/tag/v26.1.22) |
@@ -40,7 +40,7 @@ local function setup(_, options)
or th.mgr.count_copied:bg()
or "green",
cut_files_color = options.cut_files_color or th.mgr.count_cut:bg() or "red",
mask_color = th.which.mask:bg(),
mask_color = th.which.mask:bg() or "black",
}
local current_separator_style = config.separator_styles