Fix listview clearing after update

This commit is contained in:
Ben 2024-06-02 03:25:04 +02:00
parent 8cb74f5dbe
commit 6ec60f8e1c
Signed by: ben
GPG key ID: 0F54A7ED232D3319
2 changed files with 5 additions and 5 deletions

View file

@ -37,13 +37,13 @@ local function updateItemAt(idx, item)
redrawLine(idx)
end
local function clearAfter(idx)
local function clearFrom(idx)
local tw, th = frame.getSize()
for j = length, idx+1, -1 do
for j = length, idx, -1 do
backingList[j] = nil
end
length = idx
for y = paginationOffset-idx+2, th, 1 do
for y = idx-paginationOffset+1, th, 1 do
frame.setCursorPos(1, y)
frame.clearLine()
end
@ -78,7 +78,7 @@ return {
setDrawLineFunc=setDrawLineFunc,
itemAt=itemAt,
updateItemAt=updateItemAt,
clearAfter=clearAfter,
clearFrom=clearFrom,
redraw=redraw,
updatePage=updatePage,
}

View file

@ -53,7 +53,7 @@ local function fetch(wait_for)
end
wait_for(config.step_sleep_time)
end
listview.clearAfter(currentIdx)
listview.clearFrom(currentIdx)
end
local function drawLine(termlike, obj)