-
Notifications
You must be signed in to change notification settings - Fork 60
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
Typing closing bracket gives extra bracket when package loaded from startup file #166
Comments
This used to work. |
Does this only happen if OhMyREPL is loaded at startup? |
Yes it only happens if loaded at startup. |
The problem is that Pkg overwrites our keybinding for |
I have the same issue. |
I can only repro with |
My bad, nevermind. |
Pretty hacky but for now I'm working around this by adding the following after @async begin
# reinstall keybindings to work around https://github.com/KristofferC/OhMyREPL.jl/issues/166
sleep(1)
OhMyREPL.Prompt.insert_keybindings()
end |
@ssfrr's solution no longer seems to work for me? |
@ssfrr's solution seems to be working now, thanks! |
This issue also affects vim-slime plug-in (to send block of code to julia REPL for evaluation). Without ssfrr's hack, an extra ']' is appended to any line of code that has a '[' upon vim-slime transfer. This causes arrays and list comprehension syntax to be corrupted by the appended bracket. But if ssfrr's hack is added to the startup.jl after OhMyREPL, the appended ']' no longer appears on vim-slime transfer to julia REPL. |
|
Do you use vim-slime with tmux? If so, I think it's because slime doesn't use bracketed paste by default. See jpalardy/vim-slime#254 and #224. |
@carlocab Am I correct in saying that your fix to this problem was reverted in vim-slime? I am using tmux + vim-slime and facing the same issue. Did you find a workaround? |
It was reverted, yes. I haven't managed to look into a workaround -- I don't use vim-slime much lately, so the issue hasn't bothered me so much. I think the idea would be to only selectively activate bracketed paste with tmux, but I'm not sure what the best way to do that is yet. |
It doesn't only happen if in startup.jl for me. The bodge doesn't work for me. eqs = [D(x) ~ σ*(y-x),
D(y) ~ x*(ρ-z)-y,
D(z) ~ x*y - β*z] gives julia> eqs = [D(x) ~ σ*(y-x),]
1-element Vector{Equation}:
Differential(t)(x(t)) ~ σ*((y(t)) - (x(t)))
julia> D(y) ~ x*(ρ-z)-y,
D(z) ~ x*y - β*z]
ERROR: syntax: extra token "]" after end of expression |
This is (likely) an issue with Windows, you can turn off the bracket completion: https://kristofferc.github.io/OhMyREPL.jl/latest/features/bracket_complete/#Settings. |
No I am on macOS observing same behavior with The ssfrr hack above fixes the problem |
The workaround above again no longer works for me. macOS, iTerm2, Julia 1.8.1. My atreplinit() do repl
try
@info "importing OhMyREPL (incl. fzf)"
@eval using OhMyREPL
@async begin
# reinstall keybindings to work around https://github.com/KristofferC/OhMyREPL.jl/issues/166
sleep(1)
OhMyREPL.Prompt.insert_keybindings()
OhMyREPL.enable_autocomplete_brackets(false)
end
catch e
@error "error while importing OhMyREPL" e
end
end Is there any chance of disabling bracket autocompletion by default? |
@dpo I have the same system configuration, but my startup is doing: using OhMyREPL
@async begin
# reinstall keybindings to work around https://github.com/KristofferC/OhMyREPL.jl/issues/166
sleep(1)
OhMyREPL.Prompt.insert_keybindings()
end This doesn't include graceful failure or logging (I have to pass |
@iamed2 Thank you for the response. I thought the I have OhMyREPL in my global environment. Indeed, removing My config works fine with Julia 1.7. It's with Julia 1.8 that it seems to break. |
I can just confirm that |
Currently on julia
and it currently works, I switched to a sleeping while loop waiting to have a handle for the active repl, instead of just |
@ghyatzo I tried with and without |
Should this issue be closed by #297 ? |
This seems to be back in julia 1.11-beta2.
|
Typing
[]
gives[]]
The text was updated successfully, but these errors were encountered: