diff --git a/progress.scm b/progress.scm index 239fc89..c598cbc 100644 --- a/progress.scm +++ b/progress.scm @@ -116,9 +116,17 @@ (* raw-value (- (cdr range) (car range))))) (value% (* 100 value)) - (ivalue% (inexact->exact (round value%)))) + (ivalue% (inexact->exact (round value%))) + (bwidth (inexact->exact + (round + (* value (*progress%-width*))))) + (swidth (- (*progress%-width*) bwidth))) (display - (sprintf "\r[]~A% ~A" ivalue% (*current-progress%*)))))) + (sprintf "\r[~A~A]~A% ~A" + (make-string bwidth #\=) + (make-string swidth #\space) + ivalue% + (*current-progress%*)))))) ;; If the new value is different-enough from the current one, updates ;; it and re-prints the progress%