mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-27 16:03:23 +00:00
fix(nature/greenhouse): reset line offset when switching pages
This commit is contained in:
parent
179bec7ae5
commit
ec0692edeb
@ -68,14 +68,21 @@ function Greenhouse:update()
|
||||
end
|
||||
|
||||
function Greenhouse:next()
|
||||
local oldCurrent = self.curPage
|
||||
self.curPage = math.min(self.curPage + 1, #self.pages)
|
||||
self.sink:write(ansikit.getCSI(2, 'J'))
|
||||
if self.curPage ~= oldCurrent then
|
||||
self.offset = 1
|
||||
self:draw()
|
||||
end
|
||||
end
|
||||
|
||||
function Greenhouse:previous()
|
||||
local oldCurrent = self.curPage
|
||||
self.curPage = math.max(self.curPage - 1, 1)
|
||||
if self.curPage ~= oldCurrent then
|
||||
self.offset = 1
|
||||
self:draw()
|
||||
end
|
||||
end
|
||||
|
||||
return Greenhouse
|
||||
|
Loading…
x
Reference in New Issue
Block a user