feat: adapt for https://github.com/sxyazi/yazi/pull/2939
This commit is contained in:
@@ -7,7 +7,12 @@ local toggle_ui = ya.sync(function(self)
|
||||
else
|
||||
self.children = Modal:children_add(self, 10)
|
||||
end
|
||||
ya.render()
|
||||
-- TODO: remove this
|
||||
if ui.render then
|
||||
ui.render()
|
||||
else
|
||||
ya.render()
|
||||
end
|
||||
end)
|
||||
|
||||
local subscribe = ya.sync(function(self)
|
||||
@@ -18,7 +23,12 @@ end)
|
||||
local update_partitions = ya.sync(function(self, partitions)
|
||||
self.partitions = partitions
|
||||
self.cursor = math.max(0, math.min(self.cursor or 0, #self.partitions - 1))
|
||||
ya.render()
|
||||
-- TODO: remove this
|
||||
if ui.render then
|
||||
ui.render()
|
||||
else
|
||||
ya.render()
|
||||
end
|
||||
end)
|
||||
|
||||
local active_partition = ya.sync(function(self) return self.partitions[self.cursor + 1] end)
|
||||
@@ -29,7 +39,12 @@ local update_cursor = ya.sync(function(self, cursor)
|
||||
else
|
||||
self.cursor = ya.clamp(0, self.cursor + cursor, #self.partitions - 1)
|
||||
end
|
||||
ya.render()
|
||||
-- TODO: remove this
|
||||
if ui.render then
|
||||
ui.render()
|
||||
else
|
||||
ya.render()
|
||||
end
|
||||
end)
|
||||
|
||||
local M = {
|
||||
|
||||
Reference in New Issue
Block a user