You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reformat Code of last line in chunk fails with "[…] command is only valid for R code chunks" #7508
RStudio Edition : Desktop
RStudio Version : 1.3.1056 (but many earlier ones have this as well)
OS Version : macOS
R Version : 4.0.2
Steps to reproduce the problem
Insert R chunk into an .Rmd document & add some code
Select last line by double-clicking it
Try to Reformat Code
Describe the problem in detail
The fact that selecting the linebreak as well (cursor is on next line, before ```). Apparently, that is already considered outside of the code chunk.
Describe the behavior you expected
Reformatting the last line works, regardless of how it was selected. Maybe the formatter could even detect the actual code chunk contents by itself, so that Select all + Reformat code would be possible, just like in .R files.
Thanks @katrinleinweber ! I can reproduce this in RStudio Desktop 1.4.640 on MacOS 10.15.5 and going back to RStudio Server 1.2.5042 on Ubuntu 20.04. We'll check this out as we continue development of RStudio.
Activity
ronblum commentedon Aug 3, 2020
Thanks @katrinleinweber ! I can reproduce this in RStudio Desktop 1.4.640 on MacOS 10.15.5 and going back to RStudio Server 1.2.5042 on Ubuntu 20.04. We'll check this out as we continue development of RStudio.