Skip to content

Commit 478144e

Browse files
committed
Use StyledStrings Faces for stacktrace printing
This allows for the faces used (e.g. the file path) to be user-customised, which provides an escape from themes that make bright black invisible.
1 parent 4b2f6c1 commit 478144e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

base/errorshow.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ function showerror(io::IO, ex, bt; backtrace=true)
100100
end
101101
end
102102

103-
function stacktrace_path(file::Union{Nothing, String}, line::Union{Nothing, Int64})
103+
function stacktrace_path(file::Union{Nothing, String}, line::Union{Nothing, Int})
104104
realfile = if !isnothing(file) && file != "" && !startswith(String(file), "REPL")
105-
fixup_stdlib_path(String(file))
105+
String(file) |> fixup_stdlib_path |> find_source_file
106106
end
107107
pathstr = file
108108
if !isnothing(pathstr)
@@ -802,7 +802,8 @@ function print_stackframe(io, i, frame::StackFrame, n::Int, ndigits_max, modulec
802802
print(io, if inlined AnnotatedString("[inlined]", [(1:9, :face => :julia_stacktrace_inlined)]) else "" end)
803803
end
804804

805-
function print_module_path_file(io, modul, file, line; modulecolor = :bright_black, digit_align_width = 0)
805+
function print_module_path_file(io::IO, modul::Module, file::Union{Nothing, String}, line::Union{Nothing, Int};
806+
modulecolor = :bright_black, digit_align_width = 0)
806807
print(io, ' ' ^ digit_align_width, AnnotatedString("@", [(1:1, :face => :julia_stacktrace_location)]))
807808
if modul !== nothing && modulecolor !== nothing
808809
mstr = string(modul)

0 commit comments

Comments
 (0)