Skip to content

Commit e84f6ab

Browse files
committed
fix: type instability in annotated string
See JuliaLang/StyledStrings.jl#102
1 parent 80dce0d commit e84f6ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ProgressBars.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module ProgressBarsModule
22

33
using Compat: Fix
44
using ProgressMeter: Progress, next!
5-
using StyledStrings: @styled_str
5+
using StyledStrings: @styled_str, annotatedstring
66
using ..UtilsModule: AnnotatedString
77

88
# Simple wrapper for a progress bar which stores its own state
@@ -38,15 +38,15 @@ function format_for_meter((k, s), width::Integer)
3838
new_s = if occursin('\n', s)
3939
left_margin = length(" $(string(k)): ")
4040
left_padding = ' '^(width - left_margin)
41-
left_padding * newlines_to_spaces(s, width)
41+
annotatedstring(left_padding, newlines_to_spaces(s, width))
4242
else
4343
s
4444
end
4545
return (k, new_s)
4646
end
4747

4848
function newlines_to_spaces(s::AbstractString, width::Integer)
49-
return join([rpad(line, width) for line in split(s, '\n')])
49+
return join(rpad(line, width) for line in split(s, '\n'))
5050
end
5151

5252
end

0 commit comments

Comments
 (0)