From b9137fd8901778fc7bf001c08aa77aca246e5e6d Mon Sep 17 00:00:00 2001 From: Jasper Zschiegner Date: Mon, 13 Jan 2025 11:57:57 +0100 Subject: [PATCH] Fixup. --- src/state.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 0ce25b7d..cd3c2d17 100644 --- a/src/state.rs +++ b/src/state.rs @@ -198,13 +198,17 @@ impl BarState { // Now actually get the drawable. let mut drawable = self.draw_target.drawable(force_draw, now).unwrap(); + let mut draw_state = drawable.state(); + if let Some(width) = width { if !matches!(self.state.status, Status::DoneHidden) { self.style - .format_state(&self.state, &mut drawable.state().lines, width); + .format_state(&self.state, &mut draw_state.lines, width); } } + drop(draw_state); + drawable.draw() } }