From fc4e54bbe096b060a9659e8da6fce2f932082a36 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Mon, 14 Oct 2024 14:33:31 +0200 Subject: [PATCH] do not show right hand progress without colors --- src/MiniProgressBars.jl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/MiniProgressBars.jl b/src/MiniProgressBars.jl index bfb3d21658..c0a487d6b6 100644 --- a/src/MiniProgressBars.jl +++ b/src/MiniProgressBars.jl @@ -87,14 +87,18 @@ function show_progress(io::IO, p::MiniProgressBar; termwidth=nothing, carriagere if !isempty(p.status) print(io, p.status) else + hascolor = get(io, :color, false)::Bool printstyled(io, "━"^n_filled; color=p.color) if n_left > 0 - if partial_filled > 0.5 - printstyled(io, "╸"; color=p.color) # More filled, use ╸ - else - printstyled(io, "╺"; color=:light_black) # Less filled, use ╺ + if hascolor + if partial_filled > 0.5 + printstyled(io, "╸"; color=p.color) # More filled, use ╸ + else + printstyled(io, "╺"; color=:light_black) # Less filled, use ╺ + end end - printstyled(io, "━"^(n_left-1); color=:light_black) + c = hascolor ? "━" : " " + printstyled(io, c^(n_left-1+!hascolor); color=:light_black) end printstyled(io, " "; color=:light_black) print(io, progress_text)