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

Prompt pasting based on REPL mode #84

Open
richardreeve opened this issue Jun 22, 2017 · 2 comments
Open

Prompt pasting based on REPL mode #84

richardreeve opened this issue Jun 22, 2017 · 2 comments

Comments

@richardreeve
Copy link

The prompt pasting support now in base is great, but it would be even better if it could recognise REPL modes. In particular where you have an example of language switching, such as after loading RCall:

julia> a = 2
2

julia> @rput a
2

R> a
[1] 2

R> b <- a + 1

julia> @rget b
3.0

julia> b
3.0

If I paste that into the REPL, I get:

julia> a = 2
2

julia> @rput a
2

julia> @rget b
ERROR: BoundsError
Stacktrace:
 [1] getindex at /Users/richardr/.julia/v0.6/RCall/src/methods.jl:461 [inlined]
 [2] getindex(::Ptr{RCall.EnvSxp}, ::Symbol) at /Users/richardr/.julia/v0.6/RCall/src/methods.jl:464
 [3] getindex(::RCall.RObject{RCall.EnvSxp}, ::Symbol) at /Users/richardr/.julia/v0.6/RCall/src/methods.jl:465

julia> b
ERROR: UndefVarError: b not defined

and it would be great if it respected the mode switches and so just worked as well...

@pbouffard
Copy link
Contributor

pbouffard commented Apr 16, 2023

Pasting based on mode was added to the base REPL in 1.7 (JuliaLang/julia#40604), though it's currently undocumented (JuliaLang/julia#49377), and works with OhMyREPL too (at least in 1.8 and 1.9 which is what I've tried -- and I had to update from 0.5.13 to 0.5.20 for it to work properly).

@LilithHafner
Copy link

Prompt pasting is broken in OhMyREPL v0.5.24 on Julia 1.11.0-alpha2 and Julia 1.9.4 on asahi linux in VSCode. It works without OhMyREPL.

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