fix: bump version to 25.4.4

This commit is contained in:
sxyazi
2025-04-04 19:33:04 +08:00
parent 273019910c
commit 9a095057d6
3 changed files with 13 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
--- @since 25.2.26 --- @since 25.4.4
local WINDOWS = ya.target_family() == "windows" local WINDOWS = ya.target_family() == "windows"
@@ -60,7 +60,7 @@ local function root(cwd)
if cha and (cha.is_dir or is_worktree(next)) then if cha and (cha.is_dir or is_worktree(next)) then
return tostring(cwd) return tostring(cwd)
end end
cwd = cwd:parent() cwd = cwd.parent
until not cwd until not cwd
end end
@@ -68,11 +68,11 @@ local function bubble_up(changed)
local new, empty = {}, Url("") local new, empty = {}, Url("")
for path, code in pairs(changed) do for path, code in pairs(changed) do
if code ~= CODES.ignored then if code ~= CODES.ignored then
local url = Url(path):parent() local url = Url(path).parent
while url and url ~= empty do while url and url ~= empty do
local s = tostring(url) local s = tostring(url)
new[s] = (new[s] or CODES.unknown) > code and new[s] or code new[s] = (new[s] or CODES.unknown) > code and new[s] or code
url = url:parent() url = url.parent
end end
end end
end end
@@ -85,7 +85,7 @@ local function propagate_down(excluded, cwd, repo)
if rel:starts_with(path) then if rel:starts_with(path) then
-- If `cwd` is a subdirectory of an excluded directory, also mark it as `excluded` -- If `cwd` is a subdirectory of an excluded directory, also mark it as `excluded`
new[tostring(cwd)] = CODES.excluded new[tostring(cwd)] = CODES.excluded
elseif cwd == repo:join(path):parent() then elseif cwd == repo:join(path).parent then
-- If `path` is a direct subdirectory of `cwd`, mark it as `ignored` -- If `path` is a direct subdirectory of `cwd`, mark it as `ignored`
new[path] = CODES.ignored new[path] = CODES.ignored
else else
@@ -158,7 +158,7 @@ local function setup(st, opts)
Linemode:children_add(function(self) Linemode:children_add(function(self)
local url = self._file.url local url = self._file.url
local repo = st.dirs[tostring(url.base or url:parent())] -- TODO: remove this local repo = st.dirs[tostring(url.base)]
local code local code
if repo then if repo then
code = repo == CODES.excluded and CODES.ignored or st.repos[repo][tostring(url):sub(#repo + 2)] code = repo == CODES.excluded and CODES.ignored or st.repos[repo][tostring(url):sub(#repo + 2)]
@@ -166,7 +166,7 @@ local function setup(st, opts)
if not code or signs[code] == "" then if not code or signs[code] == "" then
return "" return ""
elseif self._file:is_hovered() then elseif self._file.is_hovered then
return ui.Line { " ", signs[code] } return ui.Line { " ", signs[code] }
else else
return ui.Line { " ", ui.Span(signs[code]):style(styles[code]) } return ui.Line { " ", ui.Span(signs[code]):style(styles[code]) }
@@ -175,7 +175,7 @@ local function setup(st, opts)
end end
local function fetch(_, job) local function fetch(_, job)
local cwd = job.files[1].url.base or job.files[1].url:parent() -- TODO: remove this local cwd = job.files[1].url.base
local repo = root(cwd) local repo = root(cwd)
if not repo then if not repo then
remove(tostring(cwd)) remove(tostring(cwd))

View File

@@ -1,4 +1,4 @@
--- @since 25.2.26 --- @since 25.4.4
local update = ya.sync(function(st, tags) local update = ya.sync(function(st, tags)
for path, tag in pairs(tags) do for path, tag in pairs(tags) do
@@ -27,7 +27,7 @@ local function setup(st, opts)
local url = tostring(self._file.url) local url = tostring(self._file.url)
local spans = {} local spans = {}
for _, tag in ipairs(st.tags[url] or {}) do for _, tag in ipairs(st.tags[url] or {}) do
if self._file:is_hovered() then if self._file.is_hovered then
spans[#spans + 1] = ui.Span(""):bg(st.colors[tag] or "reset") spans[#spans + 1] = ui.Span(""):bg(st.colors[tag] or "reset")
else else
spans[#spans + 1] = ui.Span(""):fg(st.colors[tag] or "reset") spans[#spans + 1] = ui.Span(""):fg(st.colors[tag] or "reset")

View File

@@ -1,4 +1,4 @@
--- @since 25.2.26 --- @since 25.4.4
local FILES = { local FILES = {
[".envrc"] = "text/plain", [".envrc"] = "text/plain",
@@ -1081,8 +1081,8 @@ function M:fetch(job)
if file.cha.len == 0 then if file.cha.len == 0 then
mime = "inode/empty" mime = "inode/empty"
else else
mime = merged_files[(file.url:name() or ""):lower()] mime = merged_files[(file.url.name or ""):lower()]
mime = mime or merged_exts[(file.url:ext() or ""):lower()] mime = mime or merged_exts[(file.url.ext or ""):lower()]
end end
if mime then if mime then