Skip to content

Commit

Permalink
don't show keymap @error for hints
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Oct 8, 2024
1 parent 4cdd864 commit dd5751f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions stdlib/REPL/src/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ const COMMAND_GROUPS =
:edit_upper_case, :edit_lower_case, :edit_title_case, :edit_indent,
:edit_transpose_lines_up!, :edit_transpose_lines_down!],
:copy => [:edit_copy_region],
:misc => [:complete_line, :setmark, :edit_undo!, :edit_redo!])
:misc => [:complete_line, :complete_line_hint, :setmark, :edit_undo!, :edit_redo!])

const COMMAND_GROUP = Dict{Symbol,Symbol}(command=>group for (group, commands) in COMMAND_GROUPS for command in commands)
command_group(command::Symbol) = get(COMMAND_GROUP, command, :nogroup)
Expand Down Expand Up @@ -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, :complete_line_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`
Expand Down Expand Up @@ -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 != :complete_line_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)
Expand Down

0 comments on commit dd5751f

Please sign in to comment.