Skip to content

Code folding issues in RMD with nested code blocks in source editor #15191

Closed

Description

@gtritchie

System details

RStudio Edition : Desktop or Server
RStudio Version : 2024.10.0+186
OS Version      : any
R Version       : any

Steps to reproduce the problem

Note: use a version of RStudio that already has the fix for #10079.

  • create a blank rmarkdown file, and in source (not visual) mode paste in:
---
title: "Test"
output: html_document
---

# A Header

````{verbatim}
We can output arbitrary content verbatim.
  
```{r}
1 + 1
```

The content can contain inline code like
`r pi * 5^2`, too.
````

# Another header 

Some content

Try using the code folding widgets in the gutter.

Describe the problem in detail

The outer chunk has beginning and ending fold widgets, as expected, but the inner chunk only has the ending widget.

initial

Collapse the inner chunk and it shows no expand widget in the gutter (but you can expand via the inline indicator):

collapse-inner

Expand the inner chunk again, then collapse the outer chunk using either the beginning or ending widget. In both cases the outer chunk only partially collapses, e.g. if you collapse the outer chunk using the starting widget:

collapse-outer-start

Describe the behavior you expected

Consistent behavior. Note that the visual editor only provides option to collapse the outer chunk, nothing on the inner chunk.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    and removed
    new
    on Sep 18, 2024
  2. self-assigned this
    on Sep 18, 2024
  3. added this to the Kousa Dogwood milestone on Sep 18, 2024
  4. gtritchie commented on Sep 19, 2024

    @gtritchie
    MemberAuthor

    Verified using 2024.10.0-hourly+191 on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions