fix: v4 changes in the preset mime plugin, closes #33
This commit is contained in:
@@ -75,7 +75,7 @@ local cands = ya.sync(function(st)
|
||||
return t
|
||||
end)
|
||||
|
||||
local function entry(_, args)
|
||||
local function entry(self, args)
|
||||
assert(args[1] == "add" or args[1] == "remove", "Invalid action")
|
||||
ya.manager_emit("escape", { visual = true })
|
||||
|
||||
@@ -94,7 +94,7 @@ local function entry(_, args)
|
||||
|
||||
local status = Command("tag"):args(t):status()
|
||||
if status.success then
|
||||
fetch { files = files }
|
||||
fetch(self, { files = files })
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1053,6 +1053,7 @@ end
|
||||
|
||||
function M:fetch(args)
|
||||
-- TODO: remove this once Yazi 0.4 is released
|
||||
local not_v4 = not args
|
||||
args = args or self
|
||||
|
||||
local opts = options()
|
||||
@@ -1083,7 +1084,7 @@ function M:fetch(args)
|
||||
|
||||
if #unknown > 0 then
|
||||
args.files = unknown
|
||||
return require("mime").fetch(args)
|
||||
return not_v4 and require("mime").fetch(args) or require("mime"):fetch(args)
|
||||
end
|
||||
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user