Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for syntax-based folding #191

Merged
merged 5 commits into from
Jan 12, 2025

Conversation

matteocoder
Copy link
Contributor

Regions, comment blocks, and heredocs can now be folded. Additionally, region names are now searchable using ctrl-r.

Regions, comment blocks, and heredocs can now be folded.
Additionally, region names are now searchable using ctrl-r.
Copy link
Member

@deathaxe deathaxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax based folding is one of the possibly more tricky ones, which may easily cause trouble if syntax is not accurate.

I've added some notes about known limitations.

Maybe we can considder adding punctuation.section.group and punctuation.section.braces as well, if they are scoped well enough (pairs can be found).

@matteocoder
Copy link
Contributor Author

matteocoder commented Jan 12, 2025

@deathaxe Thank you for your help. I've incorporated your suggestions into the latest commit. Groups and braces are folded correctly from what I've seen.

This prevents strings that are not heredocs from being foldable.
Copy link
Member

@deathaxe deathaxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good already. Maybe some advices to be better then C# ;)

@matteocoder matteocoder requested a review from deathaxe January 12, 2025 16:14
@deathaxe deathaxe merged commit a0ceb7f into SublimeText:master Jan 12, 2025
2 checks passed
@matteocoder matteocoder deleted the region-fold branch January 12, 2025 17:20
@michaelblyons
Copy link
Collaborator

Thank you, both!

@matteocoder
Copy link
Contributor Author

Thank you @michaelblyons and @deathaxe for helping me with these contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants