Skip to content

Commit 0593ff9

Browse files
committed
🐛 Fix maximum textwidth per line computation
1 parent 364849e commit 0593ff9

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/misc.jl

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -423,22 +423,7 @@ end
423423
Compute the maximum textwidth per line of the string `str`.
424424
"""
425425
function _maximum_textwidth_per_line(str::AbstractString)
426-
max_tw = 0
427-
line_tw = 0
428-
429-
for c in str
430-
if c == '\n'
431-
max_tw = max(max_tw, line_tw)
432-
line_tw = 0
433-
else
434-
line_tw += textwidth(c)
435-
end
436-
end
437-
438-
# Take into account the last line.
439-
max_tw = max(max_tw, line_tw)
440-
441-
return max_tw
426+
return maximum(printable_textwidth_per_line(str))
442427
end
443428

444429
"""

0 commit comments

Comments
 (0)