Repository navigation
Description
Verify fixed in:
- Patch: 2024.04.2
- Release: 2024.07.0
System details
RStudio Edition : Desktop
RStudio Version : 2024.04.0+735 Chocolate Cosmos (desktop)
OS Version : macOS Sonoma 14.4.1
R Version : 4.4.0 (2024-04-24)
Steps to reproduce the problem
I have quarto document (code A:starting_point below) in Rstudio. It renders as it should, but the Run All Chunks Above button does not work.
When I insert a code chunk above the ### Refs -section, unexpected behaviour takes place. This is shown in code (A:unexpected).
If there is not a function defined in the last code block (see example B1), inserting a new code chunk above the ### Refs section works as expected (outcome shown in code B2) and now, the Run All Chunks Above button does work.
If I remove
::: {#refs} :::
from the code (A:starting_point) this odd behaviour disappears.
This issue seems to share some features with issue #14642
A:starting_point:
---
title: "Untitled"
format: html
---
## Quarto
```{r}
c(1, 2)
```
### Refs
::: {#refs}
:::
## Next
```{r}
my_fun <- function(x){
x+1
}
my_fun(1)
```Consider code A:starting_point, move cursor between the first code block and the row containing ### Refs, and press Insert a new code chunk to reproduce the problem.
Describe the problem in detail
In the code A:starting_point, when there is a function defined after the ### Refs -section, unexpected behavior (code A:unexpected) is seen as far as I concern. What I would expect, is the code A:expected
The same happens if there is
::: {} :::
instead of
::: {#refs} :::
and the same happens if bibliography is defined in YAML: f.ex. bibliography: references.bib
The example function works as expected in a plain R script file.
In the example B1 (below), there is not a function defined after the section ### Refs, and what I get after inserting a new code chunk before the ### Refs section is as expected (see B2)
In Rmd-document, this issue does not take place.
Describe the behavior you expected
The expected outcome is as follows:
A:expected
---
title: "Untitled"
format: html
---
## Quarto
```{r}
c(1, 2)
```
```{r}
```
### Refs
::: {#refs}
:::
## Next
```{r}
my_fun <- function(x){
x+1
}
my_fun(1)
```Consider code B1. Again, move cursor between the first code block and the row containing ### Refs, and press Insert a new code chunk.
B1:
---
title: "Untitled"
format: html
---
## Quarto
```{r}
c(1, 2)
```
### Refs
::: {#refs}
:::
## Next
```{r}
my_fun <- c(2,3)
my_fun
```Now I get the expected behavior (see code B2), as there is not a function defined in the last code chunk.
B2:
---
title: "Untitled"
format: html
---
## Quarto
```{r}
c(1, 2)
```
```{r}
```
### Refs
::: {#refs}
:::
## Next
```{r}
my_fun <- c(2,3)
my_fun
```Actual behavior
In the case of the code A:starting_point, what I get after pressing the Insert a new code chunk -button is the following:
A:unexpected:
---
title: "Untitled"
format: html
---
## Quarto
```{r}
c(1, 2)
```
```
```{r}
### Refs
::: {#refs}
:::
## Next
```{r}
my_fun <- function(x){
x+1
}
my_fun(1)
```- [x ] I have read the guide for submitting good bug reports.
- [ x] I have installed the latest version of RStudio, and confirmed that the issue still persists.
- [ x] If I am reporting an RStudio crash, I have included a diagnostics report.
- [ x] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Activity
ronblum commentedon May 6, 2024
@kmmsks Thank you for raising this! I can reproduce this in RStudio Desktop 2024.04.0+735 on Windows 11 with both R 4.3.3 and 4.4.0. It works correctly in version 2023.12.1+402.
Also, after removing the div (
:::) section, I need to insert chunk, undo, and insert chunk again for inserting to work.gtritchie commentedon May 9, 2024
Regression caused by #14558.
olearydj commentedon May 10, 2024
This may be related to the bug I posted today #14684
ronblum commentedon May 10, 2024
QA note: Include the example in #14684 when testing.
gtritchie commentedon May 13, 2024
Another report in this area: https://forum.posit.co/t/code-blocks-not-closing-properly-from-end-backticks/186641
jaredbrewer commentedon May 13, 2024
This and the indentation issue is a major problem for me. Unless there's a timeline for a fix, it may be necessary to revert to 2023.12 until this is resolved.
gtritchie commentedon May 23, 2024
Another similar report: https://forum.posit.co/t/rstudio-2024-04-1-does-not-allow-to-run-all-code/186866
ronblum commentedon May 30, 2024
Verified in RStudio Desktop 2024.04.2+762.pro1 on Windows 11 using the original example. The followup of what happens when removing
:::is immaterial due to the fix.ronblum commentedon May 30, 2024
Verified in RStudio Desktop 2024.07.0-daily+178.pro1 on Windows 11, as well.