Skip to content

Commit ca62450

Browse files
authored
Merge pull request #161 from JuliaDebug/kc/repl_dep
avoid having a dependency on REPL
2 parents aad4cc4 + 8da1ece commit ca62450

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

‎Project.toml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ authors = ["Tim Holy <tim.holy@gmail.com>"]
55

66
[deps]
77
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
8-
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
98
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
109

1110
[compat]
12-
REPL = "1.10"
1311
julia = "1.10"
1412

1513
[extras]

‎src/CodeTracking.jl‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ using Core: LineInfoNode, MethodTable
1515
using Base.Meta: isexpr
1616
using UUIDs
1717
using InteractiveUtils
18-
using REPL: REPL
1918

2019
export code_expr, @code_expr, code_string, @code_string, whereis, definition, pkgfiles, signatures_at
2120

‎src/utils.jl‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,15 @@ function src_from_file_or_REPL(origin::AbstractString, args...)
334334
return read(origin, String)
335335
end
336336

337-
function src_from_REPL(origin::AbstractString, repl = Base.active_repl)
337+
function src_from_REPL(origin::AbstractString, repl = isdefined(Base, :active_repl) ? Base.active_repl : nothing)
338+
repl === nothing && return nothing
338339
hist_idx = parse(Int, origin)
339-
hp = repl.interface.modes[1].hist::REPL.REPLHistoryProvider
340+
hp = repl.interface.modes[1].hist
340341
entry = hp.history[hp.start_idx+hist_idx]
341342
@static if VERSION ≥ v"1.13-"
342-
return entry.content
343+
return entry.content::String
343344
else
344-
return entry
345+
return entry::String
345346
end
346347
end
347348

0 commit comments

Comments
 (0)