From 66330499871abff1dbf0c733aa9631968102a17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Thu, 6 Apr 2023 20:28:05 +0200 Subject: [PATCH] Initial change to 0 is always a change. --- src/progress.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/progress.scm b/src/progress.scm index 35d4ed7..0d33e3c 100644 --- a/src/progress.scm +++ b/src/progress.scm @@ -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%)