Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BoundsError: attempt to access ... after making selection with rofi #32

Open
jlapeyre opened this issue Apr 14, 2023 · 2 comments
Open

Comments

@jlapeyre
Copy link

@search cos(1.0) [RETURN] shows a rofi window with a single entry. Upon hitting return the rofi window disappears and I see the error:

ERROR: BoundsError: attempt to access 1-element Vector{SubString{String}} at index [2]
Stacktrace:
 [1] getindex
   @ ./essentials.jl:13 [inlined]
 [2] indexed_iterate
   @ ./tuple.jl:89 [inlined]
 [3] parse_loc(line::String)
   @ InteractiveCodeSearch ~/.julia/packages/InteractiveCodeSearch/irjIV/src/InteractiveCodeSearch.jl:180
 [4] _choose_method(#unused#::Base.HasShape{1}, methods::Base.MethodList)
   @ InteractiveCodeSearch ~/.julia/packages/InteractiveCodeSearch/irjIV/src/InteractiveCodeSearch.jl:220
 [5] choose_method
   @ ~/.julia/packages/InteractiveCodeSearch/irjIV/src/InteractiveCodeSearch.jl:189 [inlined]
 [6] search_methods(methods::Base.MethodList)
   @ InteractiveCodeSearch ~/.julia/packages/InteractiveCodeSearch/irjIV/src/InteractiveCodeSearch.jl:231
 [7] code_search_typed(f::Function, t::Type)

This happens with any search I try, including those with multiple entries in the rofi window.

Julia v"1.9.0-rc2"
rofi -v Version: 1.7.5

@jlapeyre jlapeyre changed the title BoundsError: attempt to access 1-element Vector{SubString{String}} at index [2] after making selection with rofi BoundsError: attempt to access ... after making selection with rofi Apr 14, 2023
@bergel
Copy link

bergel commented Sep 6, 2023

The error is still present. Tried with Julia 1.9.2

@jd-foster
Copy link

This is not related to rofi but is more generally a bug that happened with the change in how julia displays methods() calls.
If you're happy to dev the package, you can modify

https://github.com/tkf/InteractiveCodeSearch.jl/blob/c2479be52635c8d52c7db9ce3ba40ccd0e08fb43/src/InteractiveCodeSearch.jl#L192-L193C44

to

    _, path = rsplit(rest, " ", limit=2)
    return String(expanduser(path)), parse(Int, lineno)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants