Skip to content

Commit 6ed1d2f

Browse files
KristofferCKristofferC
and
KristofferC
authored
do not show right hand progress without colors (#4047)
Co-authored-by: KristofferC <kristoffer.carlsson@juliacomputing.com>
1 parent 799dc2d commit 6ed1d2f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/MiniProgressBars.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,18 @@ function show_progress(io::IO, p::MiniProgressBar; termwidth=nothing, carriagere
8787
if !isempty(p.status)
8888
print(io, p.status)
8989
else
90+
hascolor = get(io, :color, false)::Bool
9091
printstyled(io, ""^n_filled; color=p.color)
9192
if n_left > 0
92-
if partial_filled > 0.5
93-
printstyled(io, ""; color=p.color) # More filled, use ╸
94-
else
95-
printstyled(io, ""; color=:light_black) # Less filled, use ╺
93+
if hascolor
94+
if partial_filled > 0.5
95+
printstyled(io, ""; color=p.color) # More filled, use ╸
96+
else
97+
printstyled(io, ""; color=:light_black) # Less filled, use ╺
98+
end
9699
end
97-
printstyled(io, ""^(n_left-1); color=:light_black)
100+
c = hascolor ? "" : " "
101+
printstyled(io, c^(n_left-1+!hascolor); color=:light_black)
98102
end
99103
printstyled(io, " "; color=:light_black)
100104
print(io, progress_text)

0 commit comments

Comments
 (0)