vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Run line of code (or chunk) by Ctrl + Enter and automatically include entire chunk, advancing cursor to the next line / chunk

Open RInterested opened this issue 1 year ago • 1 comments
trafficstars

In RStudio when you run code line-by-line the cursor automatically advances down to the next line, and if it is a chunk of code broken into several lines, it runs the entire statement across multiple lines, advancing the cursor down. So you can run the entire file by just keep pressing Ctrl + Enter.

I haven't found a way to accomplish that, and I hope it is already there, or a consideration for the future.

Thank you.

RInterested avatar Apr 05 '24 12:04 RInterested

Well, here it works in the way you described, like in RStudio.

if it is a chunk of code broken into several lines,

I think the point is what you intend for a chunk of code.

Can you drop here e few lines offending this behaviour?

albertosantini avatar Apr 16 '24 11:04 albertosantini

Hi @RInterested, as noted by @albertosantini this feature is already provided in this extension. I'll close this issue for now, but if you have an example of some specific lines of code that don't seem to be working, and the specific command you are using to run them, we can re-open the issue and hopefully solve it for you.

andycraig avatar Jun 01 '24 01:06 andycraig

hi, there's another bug report that mentions this might not be working, I am also facing the same issue and I originally thought that this feature was not supported.

see here #1313

davidmasp avatar Jun 11 '24 23:06 davidmasp