Coder Social home page Coder Social logo

Comments (19)

randy3k avatar randy3k commented on August 21, 2024

Did you copy the lines one by one? Are you using something like Nvim-R to send those lines?

from radian.

randy3k avatar randy3k commented on August 21, 2024

Actually, it is myself added this feature https://github.com/randy3k/rice/blob/c5ea3ddb7182086bc63d6bf82f1cb2bb28db8d16/rice/keybinding.py#L58-L65

from radian.

jimhester avatar jimhester commented on August 21, 2024

Yes I am using Nvim-R to send the lines usually (where I first noticed this issue), but it also happens if you just copy the lines one by one.

from radian.

randy3k avatar randy3k commented on August 21, 2024

@jalvesaq and I had some discussions here jalvesaq/Nvim-R#227

He implemented an option

let R_source_args = "bracketed paste"

This option doesn't alter the behavior of \l but that of \ss and \ff. This may not be exactly what you want (I didn't). You can check if you like it or not.

An temporary solution for rice is to add an option to control the auto indentation.

A more permanent solution is to write a function <Plug>RDSendSelectionBracketed and bind \l to it in the visual mode.

from radian.

jimhester avatar jimhester commented on August 21, 2024

I have a key bound to <Plug>RDSendLine in normal mode and <Plug>REDSendSelection in visual mode. The latter works fine, the former exhibits the behavior I described (as does copying the lines manually).

👍 on an option to control the indentation

from radian.

randy3k avatar randy3k commented on August 21, 2024

close by v0.0.14

from radian.

jimhester avatar jimhester commented on August 21, 2024

Setting options(rice.auto_indentation = FALSE) seems to have no effect as far as I can tell, the behavior remains the same as before.

With rice versions 0.0.14 and 0.0.21.

from radian.

randy3k avatar randy3k commented on August 21, 2024

It seems that there is a bug in parsing rice settings. Will fix soon

from radian.

randy3k avatar randy3k commented on August 21, 2024

It is strange, 0.0.21 works for me. Could you check options("rice.auto_indentation") in rice console?

from radian.

randy3k avatar randy3k commented on August 21, 2024

By the way, you need to set it up in .Rprofile as it won't be loaded dynamically.

from radian.

jimhester avatar jimhester commented on August 21, 2024

See https://asciinema.org/a/7GbLlcLxhosnci1UjoKnmzfJ8 for what it is doing on my machine, this is just copy pasting into a rice terminal, without Nvim-R at all.

An additional issue that has appeared is rice seems to be stripping the trailing newline when pasting and I now have to explicitly hit enter to start a new line. Previous behavior retained the pasted newline, which is what I would prefer.

from radian.

randy3k avatar randy3k commented on August 21, 2024

let's keep this open.

from radian.

randy3k avatar randy3k commented on August 21, 2024

I understand what is going on now, rice.auto_indentation now only disable the indentation after the braces. What you are experiencing is an automatic indentation based on the indentation of the previous line, and it was designed by prompt_toolkit. I guess I have to also turn that off.

from radian.

randy3k avatar randy3k commented on August 21, 2024

I can also reproduce stripping newline issue.

from radian.

randy3k avatar randy3k commented on August 21, 2024

The stripping newline issue has fixed 8349baf

from radian.

randy3k avatar randy3k commented on August 21, 2024

The indentation issue is fixed 1ce94df

from radian.

randy3k avatar randy3k commented on August 21, 2024

v0.0.23 should have addressed all these.

Btw, thank you for the feedbacks. They are extremely helpful.

from radian.

jimhester avatar jimhester commented on August 21, 2024

Thanks for your persistence, can confirm it is now fixed!

from radian.

randy3k avatar randy3k commented on August 21, 2024

Just want to let you know that Nvim-R now supports bracketed paste mode jalvesaq/Nvim-R#258 so you just need to put

let g:R_bracketed_paste = 1

and Nvim-R will send the R code with bracketed paste without worrying the auto indentation. In other words, with this settings, a user can enjoy the auto indentation in the console, while the code sends through Nvim-R will not trigger auto indentation (as well as auto matching quotes/ parens).

from radian.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.