Skip to content

Problem with breadcrumbs and special-comment based sections #846

@juliasilge

Description

@juliasilge

Originally posted by @SamT123 in posit-dev/positron#8205:

Hi!

I think there may be a bug with breadcrumbs when using comment-defined sections in R (i.e. "# title ------") – but want to check here before opening an issue.

When not using comment-defined sections, breadcrumbs.focus starts with the "highlighting" focussed on the part of the code you are currently in, which is very useful for navigation:

i.e. if I do breadcrumbs.focus when my cursor is here, in my_fun_2.2:

Screenshot 2025-06-19 at 16 36 33

breadcrumbs starts with my_fun_2.2 highlighted, and I can navigate from there with the arrow keys:

Screenshot 2025-06-19 at 16 36 50

But, if there is are comment-defined sections above it, breadcrumbs seemingly doesn't know where I am in the code:

Screenshot 2025-06-19 at 16 37 08

EDIT:

The hierarchy / structure of the document in breadcrumbs is correct, its just that the highlighting doesn't start in the right place. Here I've have expanded out the folded sections:

Screenshot 2025-06-19 at 16 48 58

Positron Version: 2025.07.0 (Universal) build 134
Code - OSS Version: 1.100.0
Commit: 572a37b9b646af0b813dbe4d424bc9bfa1629646
Date: 2025-06-18T03:33:46.852Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.4.0

Any help much appreciated!
Sam

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions