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)
|
redrawLine(idx)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function clearAfter(idx)
|
local function clearFrom(idx)
|
||||||
local tw, th = frame.getSize()
|
local tw, th = frame.getSize()
|
||||||
for j = length, idx+1, -1 do
|
for j = length, idx, -1 do
|
||||||
backingList[j] = nil
|
backingList[j] = nil
|
||||||
end
|
end
|
||||||
length = idx
|
length = idx
|
||||||
for y = paginationOffset-idx+2, th, 1 do
|
for y = idx-paginationOffset+1, th, 1 do
|
||||||
frame.setCursorPos(1, y)
|
frame.setCursorPos(1, y)
|
||||||
frame.clearLine()
|
frame.clearLine()
|
||||||
end
|
end
|
||||||
|
@ -78,7 +78,7 @@ return {
|
||||||
setDrawLineFunc=setDrawLineFunc,
|
setDrawLineFunc=setDrawLineFunc,
|
||||||
itemAt=itemAt,
|
itemAt=itemAt,
|
||||||
updateItemAt=updateItemAt,
|
updateItemAt=updateItemAt,
|
||||||
clearAfter=clearAfter,
|
clearFrom=clearFrom,
|
||||||
redraw=redraw,
|
redraw=redraw,
|
||||||
updatePage=updatePage,
|
updatePage=updatePage,
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ local function fetch(wait_for)
|
||||||
end
|
end
|
||||||
wait_for(config.step_sleep_time)
|
wait_for(config.step_sleep_time)
|
||||||
end
|
end
|
||||||
listview.clearAfter(currentIdx)
|
listview.clearFrom(currentIdx)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function drawLine(termlike, obj)
|
local function drawLine(termlike, obj)
|
||||||
|
|
Loading…
Reference in a new issue