diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-13 17:52:30 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-13 17:52:30 +0000 |
| commit | 3d08ddfdbe26d259545e67f658bee462f4ad6f9c (patch) | |
| tree | 05479cad98770b774f39903071d22f6079f32044 /src/lib | |
| parent | b8716ed849952dd3d230a4a396fc925dc64b451d (diff) | |
fix: show heading in expanded view by finishing after draw target switch
The 'fetching updates...' heading was finished with finish_with_message
while the draw target was still hidden, so indicatif never rendered it.
Move the draw target switch before the heading insertion so the heading
renders immediately when added.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/client.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index 4acccb6..0c76fb1 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -474,8 +474,13 @@ impl Connect for Client { | |||
| 474 | if let Some(spinner) = spinner_for_timer { | 474 | if let Some(spinner) = spinner_for_timer { |
| 475 | spinner.finish_and_clear(); | 475 | spinner.finish_and_clear(); |
| 476 | } | 476 | } |
| 477 | // Switch draw target to make bars visible | ||
| 478 | detail_multi_for_timer | ||
| 479 | .set_draw_target(ProgressDrawTarget::stderr()); | ||
| 477 | // Add heading as a finished progress bar so it gets cleared | 480 | // Add heading as a finished progress bar so it gets cleared |
| 478 | // along with the other bars by progress_reporter.clear() | 481 | // along with the other bars by progress_reporter.clear(). |
| 482 | // Must be inserted after the draw target switch so that | ||
| 483 | // finish_with_message renders it. | ||
| 479 | let heading = detail_multi_for_timer.insert( | 484 | let heading = detail_multi_for_timer.insert( |
| 480 | 0, | 485 | 0, |
| 481 | ProgressBar::new(0).with_style( | 486 | ProgressBar::new(0).with_style( |
| @@ -483,9 +488,6 @@ impl Connect for Client { | |||
| 483 | ), | 488 | ), |
| 484 | ); | 489 | ); |
| 485 | heading.finish_with_message("fetching updates..."); | 490 | heading.finish_with_message("fetching updates..."); |
| 486 | // Switch draw target to make bars visible | ||
| 487 | detail_multi_for_timer | ||
| 488 | .set_draw_target(ProgressDrawTarget::stderr()); | ||
| 489 | // Mark as revealed and flush all bars that finished while | 491 | // Mark as revealed and flush all bars that finished while |
| 490 | // the draw target was hidden. Hold the lock across the flag | 492 | // the draw target was hidden. Hold the lock across the flag |
| 491 | // update and drain so no bar can slip through unseen (see | 493 | // update and drain so no bar can slip through unseen (see |