@@ -43,6 +43,8 @@ using StyledStrings: @styled_str
4343
4444const nmeta = 4 # number of metadata fields per block (threadid, taskid, cpu_cycle_clock, thread_sleeping)
4545
46+ const slash = Sys. iswindows () ? " \\ " : " /"
47+
4648# deprecated functions: use `getdict` instead
4749lookup (ip:: UInt ) = lookup (convert (Ptr{Cvoid}, ip))
4850
@@ -537,7 +539,7 @@ function flatten(data::Vector, lidict::LineInfoDict)
537539end
538540
539541const SRC_DIR = normpath (joinpath (Sys. BUILD_ROOT_PATH, " src" ))
540- const COMPILER_DIR = " ././. ./usr/share/julia/Compiler/"
542+ const COMPILER_DIR = " ../usr/share/julia/Compiler/"
541543
542544# Take a file-system path and try to form a concise representation of it
543545# based on the package ecosystem
@@ -554,8 +556,8 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri
554556 elseif startswith (path_norm, lib_dir)
555557 remainder = only (split (path_norm, lib_dir, keepempty= false ))
556558 return (isfile (path_norm) ? path_norm : " " ), " @julialib" , remainder
557- elseif startswith (path, COMPILER_DIR)
558- remainder = only ( split (path, COMPILER_DIR, keepempty= false ))
559+ elseif contains (path, COMPILER_DIR)
560+ remainder = split (path, COMPILER_DIR, keepempty= false )[ end ]
559561 possible_compiler_path = normpath (joinpath (Sys. BINDIR, Base. DATAROOTDIR, " julia" , " Compiler" , remainder))
560562 return (isfile (possible_compiler_path) ? possible_compiler_path : " " ), " @Compiler" , remainder
561563 elseif isabspath (path)
@@ -572,7 +574,7 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri
572574 project_file = joinpath (root, proj)
573575 if Base. isfile_casesensitive (project_file)
574576 pkgid = Base. project_file_name_uuid (project_file, " " )
575- isempty (pkgid. name) && return path # bad Project file
577+ isempty (pkgid. name) && return path, " " , path # bad Project file
576578 # return the joined the module name prefix and path suffix
577579 _short_path = path[nextind (path, sizeof (root)): end ]
578580 return path, string (" @" , pkgid. name), _short_path
@@ -944,8 +946,8 @@ function print_flat(io::IO, lilist::Vector{StackFrame},
944946 Base. printstyled (io, pkgname, color= pkgcolor)
945947 file_trunc = ltruncate (file, max (1 , wfile))
946948 wpad = wfile - textwidth (pkgname)
947- if ! isempty (pkgname) && ! startswith (file_trunc, " / " )
948- Base. print (io, " / " )
949+ if ! isempty (pkgname) && ! startswith (file_trunc, slash )
950+ Base. print (io, slash )
949951 wpad -= 1
950952 end
951953 if isempty (path)
@@ -1048,8 +1050,8 @@ function tree_format(frames::Vector{<:StackFrameTree}, level::Int, cols::Int, ma
10481050 pkgcolor = get! (() -> popfirst! (Base. STACKTRACE_MODULECOLORS), PACKAGE_FIXEDCOLORS, pkgname)
10491051 remaining_path = ltruncate (filename, max (1 , widthfile - textwidth (pkgname) - 1 ))
10501052 linenum = li. line == - 1 ? " ?" : string (li. line)
1051- slash = (! isempty (pkgname) && ! startswith (remaining_path, " / " )) ? " / " : " "
1052- styled_path = styled " {$pkgcolor:$pkgname}$slash $remaining_path:$linenum"
1053+ _slash = (! isempty (pkgname) && ! startswith (remaining_path, slash )) ? slash : " "
1054+ styled_path = styled " {$pkgcolor:$pkgname}$(_slash) $remaining_path:$linenum"
10531055 rich_file = if isempty (path)
10541056 styled_path
10551057 else
0 commit comments