Fix listview clearing after update
This commit is contained in:
parent
8cb74f5dbe
commit
6ec60f8e1c
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue