Skip to content

Horizontal lines of removed chunks never go away #1715

Open

Description

@memeplex

Describe the bug

Once you remove a code chunk the horizontal lines delimiting it stay.

Image

Then I remove the # %% line:

Image

Then I remove everything:

Image

Also, can you add an option to completely remove those lines? They are quite invasive, specially the thick one above. Moreover, even when the cursor is not inside a chunk, the last selected one keeps being surrounded by those lines, which is very misleading.

To Reproduce

I think it's clear from the description above.

Can you fix this issue by yourself? (We appreciate the help)

No

(If applicable) Please attach setting.json

  "[r]": {"editor.tabSize": 2},
  "r.rterm.mac": "/Users/carlos/.venv/bin/radian",
  // https://github.com/REditorSupport/vscode-R/issues/809#issuecomment-935947010
  "r.bracketedPaste": true,
  "r.plot.useHttpgd": true,

Environment (please complete the following information):

  • OS: macOS Tahoe
  • VSCode Version: 1.125.1
  • R Version: 4.5.3
  • vscode-R version: 2.8.8

Activity

  1. ThomasSoeiro commented on Sep 22, 2026

    @ThomasSoeiro
    Collaborator

    Edit: I can reproduce with vscode-r 3.0.0-rc.0.

    The issue is about code cells in .R files (specifics in #662 and #1455). See also e.g. https://code.visualstudio.com/docs/python/jupyter-support-py#_jupyter-code-cells, https://docs.spyder-ide.org/current/panes/editor.html?highlight=code+cells, or https://positron.posit.co/code-cells.html for documentation in other IDEs. This is different from code chunk in .Rmd files.

    I can't reproduce with vscode-r 3.0.0-rc.0.

    1. open a new file (CTRL+N)
    2. choose rmd (CTRL+K M and choose Rmd)
    3. add a code chunk, e.g.:

    ```{r}
    1 + 1
    2 + 2
    ```
    

    4. no borders are added and the chunk collapse when its content is removed

    @memeplex Please provide the exact steps, code (not screenshot only), and list of extension.

    @eitsupi Can you please add the "need info" tag?

  2. renkun-ken commented on Oct 6, 2026

    @renkun-ken
    Member

    For code cells in .R files, the current highlightCurrentChunk() sets the top/bottom border decorations when a current chunk exists, but does not clear those decorations when no current chunk is found. Removing a chunk marker or moving outside a chunk can therefore leave the previous borders visible.

    That mechanism remains in main. Keeping this open for clearing stale decorations and the requested option to disable the borders.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions