Skip to content

editor: Make the multiline comment folding more robust - #54102

Merged
tomhoule merged 3 commits into
zed-industries:mainfrom
feitreim:bugfix-multiline-comment-structural
Apr 22, 2026
Merged

editor: Make the multiline comment folding more robust#54102
tomhoule merged 3 commits into
zed-industries:mainfrom
feitreim:bugfix-multiline-comment-structural

Conversation

@feitreim

Copy link
Copy Markdown
Collaborator

Basically just applied the suggested fix as described in #53606 , I also experimented with a hackier soln. that used the same logic as the code this is replacing, but it seemed solidly worse than this version.

The original issue extremely clear with what is going on / what needed to be fixed.

heres a video:
https://github.com/user-attachments/assets/e7fc60f7-0a8c-403c-877f-93f58f370b00

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #53606

Release Notes:

  • editor: Fixed incorrect inclusion of comments into folds

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 16, 2026
@zed-community-bot zed-community-bot Bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Apr 16, 2026
@zed-codeowner-coordinator
zed-codeowner-coordinator Bot requested review from a team, cameron1024 and dinocosta and removed request for a team April 16, 2026 17:31
@tomhoule tomhoule assigned tomhoule and unassigned cameron1024 Apr 22, 2026
@tomhoule

Copy link
Copy Markdown
Contributor

@zed-zippy autofix

@tomhoule

Copy link
Copy Markdown
Contributor

There is a rustfmt check failure, but the substance of the PR is good. Once that's fixed I think we can merge. Thank you for the contribution!

@feitreim

Copy link
Copy Markdown
Collaborator Author

should be fixed now. (well I ran cargo fmt --all and the clippy script atleast). I'll keep an eye on the test runner, but im not sure if that'll run on its own.

@tomhoule
tomhoule merged commit f4addb6 into zed-industries:main Apr 22, 2026
31 checks passed
@zed-zippy zed-zippy Bot added the PR state:needs review Used to label PRs that are in need of a post-merge approval label Apr 22, 2026
@machin3io

Copy link
Copy Markdown

Thank you so much, I really appreciate it :)

@feitreim
feitreim deleted the bugfix-multiline-comment-structural branch April 22, 2026 21:02
@feitreim

Copy link
Copy Markdown
Collaborator Author

@machin3io of course! your bug report made it so easy I had to do it.

@bennetbo

Copy link
Copy Markdown
Member

@zed-industries/approved

@zed-zippy zed-zippy Bot removed the PR state:needs review Used to label PRs that are in need of a post-merge approval label Apr 22, 2026
@tomhoule

Copy link
Copy Markdown
Contributor

@bennetbo thanks, I forgot to approve before merging 🙈

kathbigra pushed a commit to kathbigra/zed that referenced this pull request May 10, 2026
…s#54102)

Basically just applied the suggested fix as described in zed-industries#53606 , I also
experimented with a hackier soln. that used the same logic as the code
this is replacing, but it seemed solidly worse than this version.

The original issue extremely clear with what is going on / what needed
to be fixed.


heres a video: 

https://github.com/user-attachments/assets/e7fc60f7-0a8c-403c-877f-93f58f370b00


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#53606 

Release Notes:

- editor: Fixed incorrect inclusion of comments into folds
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…s#54102)

Basically just applied the suggested fix as described in zed-industries#53606 , I also
experimented with a hackier soln. that used the same logic as the code
this is replacing, but it seemed solidly worse than this version.

The original issue extremely clear with what is going on / what needed
to be fixed.


heres a video: 

https://github.com/user-attachments/assets/e7fc60f7-0a8c-403c-877f-93f58f370b00


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#53606 

Release Notes:

- editor: Fixed incorrect inclusion of comments into folds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: Zero-indentation comments consumed by code folds in Python (since #50049)

6 participants