@@ -859,7 +859,6 @@ function tree_format(frames::Vector{<:StackFrameTree}, level::Int, cols::Int, ma
859
859
ndigline = ndigits (maximum (frame. frame. line for frame in frames)) + 6
860
860
ntext = max (30 , cols - ndigoverhead - nindent - ndigcounts - ndigline - 6 )
861
861
widthfile = 2 * ntext÷ 5 # min 12
862
- widthfunc = 3 * ntext÷ 5 # min 18
863
862
strs = Vector {String} (undef, length (frames))
864
863
showextra = false
865
864
if level > nindent
@@ -901,11 +900,12 @@ function tree_format(frames::Vector{<:StackFrameTree}, level::Int, cols::Int, ma
901
900
" :" ,
902
901
li. line == - 1 ? " ?" : string (li. line),
903
902
" ; " ,
904
- ltruncto ( fname, widthfunc) )
903
+ fname)
905
904
end
906
905
else
907
906
strs[i] = string (stroverhead, " ╎" , base, strcount, " [unknown stackframe]" )
908
907
end
908
+ strs[i] = ltruncto (strs[i], cols)
909
909
end
910
910
return strs
911
911
end
@@ -1161,17 +1161,17 @@ end
1161
1161
1162
1162
# Utilities
1163
1163
function rtruncto (str:: String , w:: Int )
1164
- if length (str) <= w
1164
+ if textwidth (str) <= w
1165
1165
return str
1166
1166
else
1167
- return string (" ... " , str[prevind (str, end , w- 4 ): end ])
1167
+ return string (" … " , str[prevind (str, end , w- 2 ): end ])
1168
1168
end
1169
1169
end
1170
1170
function ltruncto (str:: String , w:: Int )
1171
- if length (str) <= w
1171
+ if textwidth (str) <= w
1172
1172
return str
1173
1173
else
1174
- return string (str[1 : nextind (str, 1 , w- 4 )], " ... " )
1174
+ return string (str[1 : nextind (str, 1 , w- 2 )], " … " )
1175
1175
end
1176
1176
end
1177
1177
0 commit comments