improve textarea progress

This commit is contained in:
ruki
2020-05-03 21:54:39 +08:00
parent 9e7e5ee7b8
commit e7f865d394

View File

@@ -64,7 +64,7 @@ function textarea:draw(transparent)
if self:option("progress") then
local progress = math.floor((self._STARTLINE + math.min(self:height(), self._LINECOUNT)) * 100 / self._LINECOUNT)
if (self._STARTLINE > 0 or progress < 100) and self:width() > 20 then
self:canvas():move(self:width() - 10, self:height() - 1):putstr(string.format("(%%%d)", progress))
self:canvas():move(self:width() - 10, self:height() - 1):putstr(string.format("(%d%%)", progress))
end
end
end