Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions src/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue
panel.hist = REPL.REPLHistoryProvider(Dict{Symbol,Any}(:debug => panel))
REPL.history_reset_state(panel.hist)

search_prompt, skeymap = LineEdit.setup_search_keymap(panel.hist)
search_prompt.complete = REPL.LatexCompletions()
if VERSION < v"1.13-"
search_prompt, skeymap = LineEdit.setup_search_keymap(panel.hist)
search_prompt.complete = REPL.LatexCompletions()
end

state.main_mode = panel

Expand All @@ -59,6 +61,9 @@ function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue
command = strip(line)
end
do_print_status = true
if !(command isa AbstractString)
command = command.content
end
cmd1 = split(command,' ')[1]
do_print_status = try
execute_command(state, Val{Symbol(cmd1)}(), command)
Expand Down Expand Up @@ -144,8 +149,14 @@ function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue
end
end
)

keymaps = Dict{Any,Any}[LineEdit.history_keymap, LineEdit.default_keymap, LineEdit.escape_defaults]

state.standard_keymap = Dict{Any,Any}[skeymap, LineEdit.history_keymap, LineEdit.default_keymap, LineEdit.escape_defaults]
if VERSION < v"1.13-"
pushfirst!(keymaps, skeymap)
end

state.standard_keymap = keymaps
panel.keymap_dict = LineEdit.keymap([repl_switch;state.standard_keymap])

if initial_continue
Expand All @@ -164,7 +175,15 @@ function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue
JuliaInterpreter.maybe_next_call!(state.frame)
end
print_status(Base.pipe_writer(terminal), active_frame(state); force_lowered=state.lowered_status)
REPL.run_interface(terminal, LineEdit.ModalInterface([panel,search_prompt]))

prompts = [panel]

if VERSION < v"1.13-"
push!(prompts, search_prompt)
end


REPL.run_interface(terminal, LineEdit.ModalInterface(prompts))

return state.overall_result
end
Expand Down Expand Up @@ -261,7 +280,7 @@ function completions(c::DebugCompletionProvider, full, partial)
Base.eval(m, :($(v.name) = $(QuoteNode(v.value))))
end

comps2, range2, should_complete2 = REPLCompletions.completions(full, lastindex(partial), m)
comps2, range2, should_complete2 = Base.invokelatest(REPLCompletions.completions, full, lastindex(partial), m)
ret2 = map(REPLCompletions.completion_text, comps2)

ret = sort!(unique!(vcat(ret1, ret2)))
Expand Down
2 changes: 1 addition & 1 deletion test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ finally
Debugger.set_highlight(Debugger.HIGHLIGHT_OFF)
end

frame = @make_frame Test.eval(1)
frame = @make_frame Test.TestLogger()
desc = Debugger.locdesc(frame)
@test occursin(Sys.STDLIB, desc)

Expand Down
Loading