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

Bracket completion doesn't play well with tab-completion #334

Open
axsk opened this issue Dec 9, 2023 · 7 comments
Open

Bracket completion doesn't play well with tab-completion #334

axsk opened this issue Dec 9, 2023 · 7 comments

Comments

@axsk
Copy link

axsk commented Dec 9, 2023

When typing include("myf<tab> this ends up with include("myfile.jl"")

Supposedly typing " adds the first closing ", and tab completion the second.

@axsk
Copy link
Author

axsk commented Dec 9, 2023

Not quite the same, but when having include("myfile.jl in the REPL and typing " it results in "". Here context lookup would be nice to not close the " automatically, and I suppose similar for brackets..

@mihrits
Copy link

mihrits commented Jan 4, 2024

I have also been having this issue after installing Julia 1.10. This works as expected in 1.9. Doesn't seem to matter whether OhMyREPL is loaded at startup or later.

@scheinerman
Copy link

I'm having the same issue. Furthermore, after autocompletion by tabbing the cursor is on the extraneous quotation mark. Pressing delete removes BOTH quotation marks on the right. Then if I type a quotation mark to close the string, two appear again! To remove the extraneous quotation mark, I need to press the right arrow key and then delete.

@chriselrod
Copy link
Contributor

I have also been having this issue after installing Julia 1.10. This works as expected in 1.9. Doesn't seem to matter whether OhMyREPL is loaded at startup or later.

Yes, this is not an OhMyREPL issue, but a Julia 1.10 issue.

@scheinerman
Copy link

I have also been having this issue after installing Julia 1.10. This works as expected in 1.9. Doesn't seem to matter whether OhMyREPL is loaded at startup or later.

Yes, this is not an OhMyREPL issue, but a Julia 1.10 issue.

Assume there is a file foo.jl on disk:

include("foo<TAB

produces a repeated " at the end:

include("foo.jl"")

This behavior was not present in previous Julia versions.

I switched off OhMyREPL by starting Julia with julia --startup-file=no and the problem does not happen for me (using version 1.10.1). Tab completion works fine. But if I allow OhMyREPL either via my startup.jl or by using OhMyREPL, the problem persists. So, at least for me, this does seem to be an OhMyREPL issue.

@chriselrod
Copy link
Contributor

chriselrod commented Feb 22, 2024

I get the problem with --startup=no on Julia 1.10.

I think the confusion is because OhMyREPL automatically closes quotes, i.e. if | is your cursor, you get

julia> include(|

type "

julia> include("|"

i.e., it adds a closing quote for you automatically.
You can disable this behavior with

enable_autocomplete_brackets(false)

Julia 1.10 introduced the problem that \tab completion automatically closes the quote.
So if you have "foo\tab, you get "foo.jl".
If you already had a close-quote, you now have two close quotes.

The bad interaction with OhMyREPL.jl is that it adds a close quote, so now you basically always have "foo\tab" -> "foo.jl"".
If you already have that closing quote for other reasons, you'll still get the annoying double-close on Julia 1.10.

@StefanKarpinski
Copy link

I think the way many editors handle this is that when you type the final " it replaces the one that's already there. Not sure what the full logic is, but I believe that's what many seem to do.

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

5 participants