@@ -264,7 +264,8 @@ impl OmaMultiProgressBar {
264
264
let pb = self
265
265
. mb
266
266
. insert ( index + 1 , ProgressBar :: new_spinner ( ) . with_style ( sty) ) ;
267
- pb. set_message ( format ! ( "({}/{total}) {msg}" , index + 1 ) ) ;
267
+ let total_width = total_width ( total) ;
268
+ pb. set_message ( format ! ( "({:>total_width$}/{total}) {msg}" , index + 1 ) ) ;
268
269
pb. enable_steady_tick ( inv) ;
269
270
self . pb_map . insert ( index + 1 , pb) ;
270
271
}
@@ -278,7 +279,8 @@ impl OmaMultiProgressBar {
278
279
let pb = self
279
280
. mb
280
281
. insert ( index + 1 , ProgressBar :: new ( size) . with_style ( sty) ) ;
281
- pb. set_message ( format ! ( "({}/{total}) {msg}" , index + 1 ) ) ;
282
+ let total_width = total_width ( total) ;
283
+ pb. set_message ( format ! ( "({:>total_width$}/{total}) {msg}" , index + 1 ) ) ;
282
284
self . pb_map . insert ( index + 1 , pb) ;
283
285
}
284
286
Event :: ProgressInc { index, size } => {
@@ -378,6 +380,11 @@ impl OmaMultiProgressBar {
378
380
}
379
381
}
380
382
383
+ #[ inline]
384
+ fn total_width ( total : usize ) -> usize {
385
+ total. to_string ( ) . len ( )
386
+ }
387
+
381
388
fn osc94 ( is_refresh : bool , download_only : bool , pos : u64 , gpb : & ProgressBar ) {
382
389
if let Some ( len) = gpb. length ( )
383
390
&& !is_refresh
0 commit comments