diff --git a/git.yazi/init.lua b/git.yazi/init.lua index a64b749..7ea5622 100644 --- a/git.yazi/init.lua +++ b/git.yazi/init.lua @@ -154,10 +154,7 @@ local function setup(st, opts) end, opts.order) end -local function fetch(self, job) - -- TODO: remove this once Yazi 0.4 is released - job = job or self - +local function fetch(_, job) local cwd = job.files[1].url:parent() local repo = root(cwd) if not repo then diff --git a/lsar.yazi/init.lua b/lsar.yazi/init.lua index b7e46dd..06fec62 100644 --- a/lsar.yazi/init.lua +++ b/lsar.yazi/init.lua @@ -1,9 +1,6 @@ local M = {} function M:peek(job) - -- TODO: remove this once Yazi 0.4 is released - job = job or self - local child, code = Command("lsar"):arg(tostring(job.file.url)):stdout(Command.PIPED):spawn() if not child then return ya.err("spawn `lsar` command returns " .. tostring(code)) @@ -39,19 +36,6 @@ function M:peek(job) end end -function M:seek(job) - -- TODO: remove this once Yazi 0.4 is released - local units = type(job) == "table" and job.units or job - job = type(job) == "table" and job or self - - local h = cx.active.current.hovered - if h and h.url == job.file.url then - local step = math.floor(units * job.area.h / 10) - ya.manager_emit("peek", { - math.max(0, cx.active.preview.skip + step), - only_if = job.file.url, - }) - end -end +function M:seek(job) require("code"):seek(job) end return M diff --git a/mactag.yazi/init.lua b/mactag.yazi/init.lua index 7557fcf..712559d 100644 --- a/mactag.yazi/init.lua +++ b/mactag.yazi/init.lua @@ -35,10 +35,7 @@ local function setup(st, opts) end, 500) end -local function fetch(self, job) - -- TODO: remove this once Yazi 0.4 is released - job = job or self - +local function fetch(_, job) local paths = {} for _, file in ipairs(job.files) do paths[#paths + 1] = tostring(file.url) @@ -76,10 +73,7 @@ local cands = ya.sync(function(st) end) local function entry(self, job) - -- TODO: remove this once Yazi 0.4 is released - local args = job.args or job - - assert(args[1] == "add" or args[1] == "remove", "Invalid action") + assert(job.args[1] == "add" or job.args[1] == "remove", "Invalid action") ya.manager_emit("escape", { visual = true }) local cands = cands() @@ -88,7 +82,7 @@ local function entry(self, job) return end - local t = { args[1] == "remove" and "-r" or "-a", cands[choice].desc } + local t = { job.args[1] == "remove" and "-r" or "-a", cands[choice].desc } local files = {} for _, url in ipairs(selected_or_hovered()) do t[#t + 1] = tostring(url) diff --git a/mime-ext.yazi/init.lua b/mime-ext.yazi/init.lua index 9fc0830..f2747a0 100644 --- a/mime-ext.yazi/init.lua +++ b/mime-ext.yazi/init.lua @@ -1060,10 +1060,6 @@ function M:setup(opts) end function M:fetch(job) - -- TODO: remove this once Yazi 0.4 is released - local not_v4 = not job - job = job or self - local opts = options() local merged_files = ya.dict_merge(FILES, opts.with_files or {}) local merged_exts = ya.dict_merge(EXTS, opts.with_exts or {}) @@ -1089,12 +1085,11 @@ function M:fetch(job) if next(updates) then ya.manager_emit("update_mimes", { updates = updates }) - ya.manager_emit("update_mimetype", { updates = updates }) -- TODO: remove this end if #unknown > 0 then job.files = unknown - return not_v4 and require("mime").fetch(job) or require("mime"):fetch(job) + return require("mime"):fetch(job) end return 1 diff --git a/no-status.yazi/init.lua b/no-status.yazi/init.lua index 3198ef1..2385600 100644 --- a/no-status.yazi/init.lua +++ b/no-status.yazi/init.lua @@ -1,13 +1,7 @@ local function setup() local old_layout = Tab.layout - -- TODO: remove this check once v0.4 is released - if Status.redraw then - Status.redraw = function() return {} end - else - Status.render = function() return {} end - end - + Status.redraw = function() return {} end Tab.layout = function(self, ...) self._area = ui.Rect { x = self._area.x, y = self._area.y, w = self._area.w, h = self._area.h + 1 } return old_layout(self, ...)