Skip to content

Commit

Permalink
Use maybe_fix_path in ascend
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jul 24, 2024
1 parent 602c849 commit aced937
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Cthulhu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Cthulhu

Base.Experimental.@compiler_options compile=min optimize=1

using CodeTracking: definition, whereis
using CodeTracking: CodeTracking, definition, whereis, maybe_fix_path
using InteractiveUtils
using UUIDs
using REPL: REPL, AbstractTerminal
Expand Down Expand Up @@ -832,6 +832,7 @@ function ascend(term, mi; interp::AbstractInterpreter=NativeInterpreter(), kwarg
miparent = instance(node.parent.data.nd)
ulocs = find_caller_of(interp, miparent, mi; allow_unspecialized=true)
if !isempty(ulocs)
ulocs = [(k[1], maybe_fix_path(String(k[2])), k[3]) => v for (k, v) in ulocs]
strlocs = [string(" "^k[3] * '"', k[2], "\", ", k[1], ": lines ", v) for (k, v) in ulocs]
explain_inlining = length(ulocs) > 1 ? "(including inlined callers represented by indentation) " : ""
push!(strlocs, "Browse typed code")
Expand All @@ -846,8 +847,8 @@ function ascend(term, mi; interp::AbstractInterpreter=NativeInterpreter(), kwarg
end
choice2 = TerminalMenus.request(term, promptstr, linemenu; cursor=choice2)
if 0 < choice2 < length(strlocs)
loc = ulocs[choice2]
edit(String(loc[1][2]), first(loc[2]))
loc, lines = ulocs[choice2]
edit(loc[2], first(lines))
elseif choice2 == length(strlocs)
browsecodetyped = true
break
Expand Down

0 comments on commit aced937

Please sign in to comment.