Initial change to 0 is always a change.

This commit is contained in:
Dominik Pantůček 2023-04-06 20:28:05 +02:00
parent cb648b260d
commit 6633049987

View file

@ -134,7 +134,8 @@
(when (*current-progress%*)
(*current-progress%-value* new-value)
(let ((old-value (*current-progress%-last-value*)))
(when (>= (abs (- new-value old-value)) (*progress%-step*))
(when (or (not old-value)
(>= (abs (- new-value old-value)) (*progress%-step*)))
(*current-progress%-last-value* new-value)
(print-current-progress%)))))
@ -142,7 +143,7 @@
(define (run-with-progress% echo? name thunk)
(parameterize ((*current-progress%* name)
(*current-progress%-echo?* echo?)
(*current-progress%-value* 0)
(*current-progress%-value* #f)
(*current-progress%-last-value* 0)
(*current-progress%-range* (cons 0 1)))
(print-current-progress%)