|
1 | 1 |
|
2 | 2 | function assert_allow_step(state) |
3 | 3 | if state.broke_on_error |
4 | | - printstyled(stderr, "Cannot step after breaking on error\n"; color=:red) |
| 4 | + printstyled(stderr, "Cannot step after breaking on error\n"; color=Base.error_color()) |
5 | 5 | return false |
6 | 6 | end |
7 | 7 | if state.level != 1 |
8 | | - printstyled(stderr, "Cannot step in a non leaf frame\n"; color=:red) |
| 8 | + printstyled(stderr, "Cannot step in a non leaf frame\n"; color=Base.error_color()) |
9 | 9 | return false |
10 | 10 | end |
11 | 11 | return true |
@@ -85,13 +85,13 @@ function execute_command(state::DebuggerState, ::Union{Val{:f}, Val{:fr}}, cmd) |
85 | 85 | else |
86 | 86 | new_level = tryparse(Int, subcmds[2]) |
87 | 87 | if new_level == nothing |
88 | | - printstyled(stderr, "Failed to parse $(repr(subcmds[2])) as an integer\n"; color=:red) |
| 88 | + printstyled(stderr, "Failed to parse $(repr(subcmds[2])) as an integer\n"; color=Base.error_color()) |
89 | 89 | return false |
90 | 90 | end |
91 | 91 | end |
92 | 92 |
|
93 | 93 | if new_level > stacklength(state.frame) || new_level < 1 |
94 | | - printstyled(stderr, "Not a valid frame index\n"; color=:red) |
| 94 | + printstyled(stderr, "Not a valid frame index\n"; color=Base.error_color()) |
95 | 95 | return false |
96 | 96 | end |
97 | 97 |
|
@@ -179,12 +179,12 @@ function execute_command(state::DebuggerState, ::Val{:o}, cmd::AbstractString) |
179 | 179 | frame = active_frame(state) |
180 | 180 | loc = JuliaInterpreter.whereis(frame) |
181 | 181 | if loc === nothing |
182 | | - printstyled(stderr, "Could not find source location\n"; color=:red) |
| 182 | + printstyled(stderr, "Could not find source location\n"; color=Base.error_color()) |
183 | 183 | return false |
184 | 184 | end |
185 | 185 | file, line = loc |
186 | 186 | if !isfile(file) |
187 | | - printstyled(stderr, "Could not find file: $(repr(file))\n"; color=:red) |
| 187 | + printstyled(stderr, "Could not find file: $(repr(file))\n"; color=Base.error_color()) |
188 | 188 | return false |
189 | 189 | end |
190 | 190 | InteractiveUtils.edit(file, line) |
|
0 commit comments