From c77f75442f77623ce51219ec007719ec2937314e Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 8 Oct 2024 07:06:01 -0400 Subject: [PATCH] don't show keymap `@error` for hints --- stdlib/REPL/src/LineEdit.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index 5af03e0df9b6d3..a0be17e13a2aae 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -382,6 +382,7 @@ function check_for_hint(s::MIState) # Requires making space for them earlier in refresh_multi_line return clear_hint(st) end + set_action!(s, :check_for_hint) completions, partial, should_complete = complete_line(st.p.complete, st, s.active_module; hint = true)::Tuple{Vector{String},String,Bool} isempty(completions) && return clear_hint(st) # Don't complete for single chars, given e.g. `x` completes to `xor` @@ -2871,7 +2872,9 @@ function prompt!(term::TextTerminal, prompt::ModalInterface, s::MIState = init_s try status = fcn(s, kdata) catch e - @error "Error in the keymap" exception=e,catch_backtrace() + if s.current_action != :check_for_hint + @error "Error in the keymap" exception=e,catch_backtrace() + end # try to cleanup and get `s` back to its original state before returning transition(s, :reset) transition(s, old_state)