From 56d2c0acdeb665cf9a2d2d7929d4fae1946b58f3 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 11 Aug 2024 17:12:40 +0200 Subject: [PATCH] fix some length -> textwidth --- stdlib/Profile/src/Profile.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index ad26dfcd27bfd..ba3532fd92b9e 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -813,7 +813,7 @@ function print_flat(io::IO, lilist::Vector{StackFrame}, for i in eachindex(lilist) li = lilist[i] maxline = max(maxline, li.line) - maxfunc = max(maxfunc, length(funcnames[i])) + maxfunc = max(maxfunc, textwidth(funcnames[i])) maxfile = max(maxfile, sum(textwidth, pkgnames_filenames[i]) + 1) end wline = max(5, ndigits(maxline)) @@ -945,7 +945,7 @@ function tree_format(frames::Vector{<:StackFrameTree}, level::Int, cols::Int, ma fname) end pkgcolor = get!(() -> popfirst!(Base.STACKTRACE_MODULECOLORS), PACKAGE_FIXEDCOLORS, pkgname) - remaining_path = ltruncate(filename, widthfile - length(pkgname) - 1) + remaining_path = ltruncate(filename, widthfile - textwidth(pkgname) - 1) strs[i] = Base.annotatedstring(stroverhead, "╎", base, strcount, " ", styled"{$pkgcolor:$pkgname}", !isempty(pkgname) && !startswith(remaining_path, "/") ? "/" : "",