When I have multiple source columns in RStudio (e.g. by View > Panes > Add Source Column), and one of the columns is a QMD, Command + Enter usually only runs the current line in one of the columns.
Cmd + Enter works when I first open the Quarto file, or if I click the tab of the Quarto file before running. Clicking into the file's window and selecting a line, though, isn't enough.
Reproduction steps.
- Create the files
fileA.R
print("Hello World")
fileB.qmd
---
title: "Untitled"
format: html
---
```{r}
x <- "Goodbye Earth"
x
```
- Open fileA.R
- Open fileB.qmd with File > Open File in New Column (I have not found a difference depending on which file is opened first, or which column each file is in.)
- Set editor mode to "Visual" in Quarto file
- Place cursor in fileA.R, hit Command + Enter; view console output
- Place cursor in fileB.qmd, hit Command + Enter; view chunk and console output. It should* print "Hello World" from fileA.R instead of "Goodbye Earth" from fileB.qmd
- If step 5 properly prints "Goodbye Earth", then repeat steps 4 and 5. (Sometimes fileB.qmd runs properly when it's first opened for me.)
- Click the tab for fileB.qmd
- Place cursor on line in fileB.qmd, hit Command Enter; view the chunk and console output. For me it now prints "Goodbye Earth"
*"Should", as in, to imitate the problem I'm experiencing
Note that this only occurs with Visual editor mode and not Source (or markdown) editor mode for the QMD.
RStudio Version
Version 2023.06.1+524
sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5