diff --git a/src/repl.jl b/src/repl.jl index d6669ce..7a53cd8 100644 --- a/src/repl.jl +++ b/src/repl.jl @@ -283,10 +283,13 @@ end NEW_KEYBINDINGS = create_keybindings() function insert_keybindings(repl = Base.active_repl) - mirepl = isdefined(repl,:mi) ? repl.mi : repl - main_mode = mirepl.interface.modes[1] - p = mirepl.interface.modes[5] + mirepl = isdefined(repl,:mistate) ? repl.mistate : repl + interface_modes = mirepl.interface.modes + main_mode = interface_modes[1] + php_idx = findfirst(Base.Fix2(isa, LineEdit.PrefixHistoryPrompt), interface_modes) + p = interface_modes[php_idx] + # Up Arrow NEW_KEYBINDINGS["\e[A"] = (s,o...)-> begin LineEdit.edit_move_up(buffer(s)) || LineEdit.enter_prefix_search(s, p, true) Prompt.rewrite_with_ANSI(s)