fix(CountersSelector): bad writeLine function

This commit is contained in:
Guillaume ARM 2024-05-23 21:58:41 +02:00
parent 7f7d3e801e
commit 4903f0a96c

View File

@ -31,15 +31,15 @@ local function withColor(win, textColor, backgroundColor, callbackFn)
return table.unpack(result)
end
local function createWriteWithColor(textColor, backgroundColor, givenWin)
local win = givenWin or term
-- local function createWriteWithColor(textColor, backgroundColor, givenWin)
-- local win = givenWin or term
return function(str)
return withColor(win, textColor, backgroundColor, function()
return win.write(str)
end)
end
end
-- return function(str)
-- return withColor(win, textColor, backgroundColor, function()
-- return win.write(str)
-- end)
-- end
-- end
local function getTotalCount(countersMap)
local total = 0
@ -105,7 +105,9 @@ local function renderCountersMap(win, countersMap, selectedCounter)
for k,v in pairs(displayedCounters) do
win.setCursorPos(1, cursorYIndex)
local writeLine = function() return tostring(v.name) .. ' ' .. tostring(v.count) end
local writeLine = function()
win.write(tostring(v.name) .. ' ' .. tostring(v.count))
end
if k == selectedCounter then
withColor(win, colors.black, colors.white, writeLine)