randy3k / radian

A 21 century R console
MIT License
1.96k stars 73 forks source link

`ctrl-enter` does not run command when linebreaks are used within function calls #457

Open bfrank5 opened 5 months ago

bfrank5 commented 5 months ago

I have noticed that commands are not always automatically ran when using ctrl-enter to send commands to the R interactive terminal when using VSCode. My educated guess is that this is caused by linebreaks within function calls.

For example,

print("here")

seems to work when sending to the terminal but

print(
  "here"
)

does not. By which I mean the command is sent to the terminal, but it is not executed automatically. I have to manually click the terminal and hit enter, then click back to the editor pane.

Some other examples:

print(
  "here")

seems to work as well as

print("here"
)

Any ideas? I also use vi mode, not sure if that is related.

willvieira commented 2 months ago

This problem seems to be associated with the VSCode extension vscode-R.

I fixed it following the recommendations from here: you have to activate the R: Bracketed Paste option in the VSCode settings.