Code blocks not closing properly from end backticks

I am editing an R code block in a quarto document in RStudio 2024.04.0+735.

When I attempt to fold closed the code block by clicking on the flippy triangle at the end of the code block, RStudio attempts to match this up with some point in the code below this point, and not with the beginning of the code block above this point. Thus the folding closed fails.

Using the flippy triangle at the beginning of the code block folds closed (and reopens) the block just fine.

I have not tried this with any other document type or code block type. I do recall this feature worked as intended with some earlier version of RStudio, but I do not recall which one.

Is there some setting/option I missed, or might this be a minor bug?


version info:
RStudio 2024.04.0+735 "Chocolate Cosmos" Release (a00d0e775dbc93e0d79a1bf474e3e8e8de677383, 2024-04-24) for macOS Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2024.04.0+735 Chrome/120.0.6099.291 Electron/28.2.6 Safari/537.36, Quarto 1.4.554 (~/Applications/quarto/bin/quarto)

Yes, there are some bugs in this area in the latest release of RStudio. We are working on the fixes; at this point I don't know when those will be available. It's possible (but undecided as I write this) that these fixes might make it into a patch release (e.g. 2024.04.2) or the next release slated for this summer.

Take a look at these issues. If these seem to cover what you are experiencing then a thumbs-up upvote is helpful (we do pay attention to upvote counts when setting priorities). If not, then please open a new issue with repro steps .

Thanks Gary. These aren't quite the same issue, so I opened a new issue report here.

Thank you. I did some preliminary investigation, and sure enough this has a different root cause than the other issues I mentioned.