caleb-allen / VimBindings.jl

Vim bindings for the Julia REPL
https://caleb-allen.github.io/VimBindings.jl/
MIT License
113 stars 3 forks source link

`enter_prefix_search` no longer exists on 1.11 #101

Closed MilesCranmer closed 4 months ago

MilesCranmer commented 4 months ago

I guess this function was removed on 1.11 (rc1). When trying to type "k" to move upwards I get this message:

┌ Error: Error in the keymap
│   exception =
│    MethodError: no method matching enter_prefix_search(::REPL.LineEdit.MIState, ::REPL.LineEdit.HistoryPrompt, ::Bool)
│    The function `enter_prefix_search` exists, but no method is defined for this combination of argument types.
│    
│    Closest candidates are:
│      enter_prefix_search(::REPL.LineEdit.MIState, ::REPL.LineEdit.PrefixHistoryPrompt, ::Bool)
│       @ REPL ~/.julia/juliaup/julia-1.11.0-rc1+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2203
│    
│    Stacktrace:
│     [1] (::OhMyREPL.Prompt.var"#55#57"{REPL.LineEdit.HistoryPrompt})(::Any, ::Any, ::Vararg{Any})
│       @ OhMyREPL.Prompt ~/.julia/packages/OhMyREPL/6UG7a/src/repl.jl:291
│     [2] #invokelatest#2
│       @ ./essentials.jl:1043 [inlined]
│     [3] invokelatest
│       @ ./essentials.jl:1040 [inlined]
│     [4] (::VimBindings.var"#8#10"{OhMyREPL.Prompt.var"#55#57"{REPL.LineEdit.HistoryPrompt}, String})(s::REPL.LineEdit.MIState, p::REPL.LineEditREPL)
│       @ VimBindings ~/.julia/packages/VimBindings/Kxkt0/src/lineeditalt.jl:69
│     [5] prompt!(term::REPL.Terminals.TTYTerminal, prompt::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│       @ VimBindings ~/.julia/packages/VimBindings/Kxkt0/src/lineeditalt.jl:34
│     [6] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│       @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.0-rc1+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2744
│     [7] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
│       @ REPL ~/.julia/juliaup/julia-1.11.0-rc1+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1454
│     [8] (::REPL.var"#75#81"{REPL.LineEditREPL, REPL.REPLBackendRef})()
│       @ REPL ~/.julia/juliaup/julia-1.11.0-rc1+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/REPL/src/REPL.jl:459
└ @ VimBindings ~/.julia/packages/VimBindings/Kxkt0/src/lineeditalt.jl:36
MilesCranmer commented 4 months ago

Oh wait, sorry, it seems to be an issue with OhMyREPL that somehow manifested through VimBindings!

MilesCranmer commented 4 months ago

Main issue: https://github.com/KristofferC/OhMyREPL.jl/issues/349

caleb-allen commented 4 months ago

Despite the root cause being outside of VimBindings, it would be an improvement not to call the prefix search function directly, perhaps passing through the up or down key sequences. The current mechanism for prefix search is already buggy, like in #93, as well as its nonstandard behavior: j and k move up within a prompt entry when there are multiple lines, instead of navigating to the previous prompt like the up key does.