From 9e37e1b65873f0c41e71a25d7065a5bb9ebf050e Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Sun, 13 Oct 2024 16:21:24 -0300 Subject: [PATCH] Fix end of progress bar (#4045) --- src/MiniProgressBars.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MiniProgressBars.jl b/src/MiniProgressBars.jl index 041357e244..bfb3d21658 100644 --- a/src/MiniProgressBars.jl +++ b/src/MiniProgressBars.jl @@ -74,7 +74,7 @@ function show_progress(io::IO, p::MiniProgressBar; termwidth=nothing, carriagere max_progress_width = max(0, min(termwidth - textwidth(p.header) - textwidth(progress_text) - 10 , p.width)) n_filled = floor(Int, max_progress_width * perc / 100) partial_filled = (max_progress_width * perc / 100) - n_filled - n_left = max_progress_width - n_filled - 1 + n_left = max_progress_width - n_filled headers = split(p.header) to_print = sprint(; context=io) do io print(io, " "^p.indent) @@ -94,7 +94,7 @@ function show_progress(io::IO, p::MiniProgressBar; termwidth=nothing, carriagere else printstyled(io, "╺"; color=:light_black) # Less filled, use ╺ end - printstyled(io, "━"^n_left; color=:light_black) + printstyled(io, "━"^(n_left-1); color=:light_black) end printstyled(io, " "; color=:light_black) print(io, progress_text)