feat: compatibility with Yazi v0.4 for the no-status plugin

This commit is contained in:
sxyazi
2024-11-03 17:51:39 +08:00
parent ad52adf917
commit 102a0cd75d
2 changed files with 9 additions and 1 deletions

View File

@@ -29,6 +29,8 @@ return {
local output, err = Command("diff"):arg("-Naur"):arg(tostring(a)):arg(tostring(b)):output()
if not output then
return info("Failed to run diff, error: " .. err)
elseif output.stdout == "" then
return info("No differences found")
end
ya.clipboard(output.stdout)

View File

@@ -1,7 +1,13 @@
local function setup()
local old_layout = Tab.layout
Status.render = function() return {} end
-- 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
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, ...)