Skip to content

Commit e935b83

Browse files
authored
show an error message on empty first command (#149)
1 parent f8720a9 commit e935b83

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Advanced commands:
5656
- `si`: same as `se` but step into a call if a call is the next expression
5757
- `sg`: step into a generated function
5858

59+
An empty command will execute the previous command.
60+
5961
### Breakpoints
6062

6163
There are currently no designated commands in the debug mode for adding and removing breakpoints, instead they are manipulated using the API from the package JuliaInterpreter (which is reexported from Debugger). The different ways of manipulating breakpoints are documented [here](https://juliadebug.github.io/JuliaInterpreter.jl/latest/dev_reference/#Breakpoints-1).

src/repl.jl

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue
4040
LineEdit.reset_state(s)
4141
return false
4242
end
43-
if isempty(strip(line)) && length(panel.hist.history) > 0
43+
if length(panel.hist.history) == 0
44+
printstyled(stderr, "no previous command executed\n"; color=Base.error_color())
45+
return false
46+
end
47+
if isempty(strip(line))
4448
command = panel.hist.history[end]
4549
else
4650
command = strip(line)

0 commit comments

Comments
 (0)