Skip to content

Commit fc3db45

Browse files
committed
fix: only update progress bar when percentage changes
1 parent 16732d4 commit fc3db45

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/ansi/src/init.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ function ansi.ProgressBar(label)
136136
local pct = ratio and string.format("%3d%%", math.floor(ratio * 100)) or nil
137137
local elapsed = formatElapsed(os.clock() - startTime)
138138

139-
local key = (barStr or "") .. (pct or "") .. (info or "")
140-
if key == lastRendered then return end
141-
lastRendered = key
139+
if pct == lastRendered then return end
140+
lastRendered = pct
142141

143142
local line = ESC .. "2K\r" .. colors.gray .. " - " .. colors.reset .. label
144143
if barStr then

0 commit comments

Comments
 (0)