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

Header folding broken with fenced blocks (the whole document is folded) #733

Closed
eugenesvk opened this issue Aug 10, 2023 · 1 comment
Closed
Labels
bug C: syntax Category: syntax definition

Comments

@eugenesvk
Copy link
Contributor

broken MarkdownEditing is the only plugin installed in safe mode

mdedit2.mov

correct (no plugins installed, safe mode)

mdedit1.mov
@deathaxe
Copy link
Member

MarkdownEditing syntax and folding rules from https://github.com/sublimehq/Packages with few extensions to support more syntaxes in fenced code blocks.

The issue is caused by introducing syntax based folding for fenced code-blocks in sublimehq/Packages#3782 and yet another example for how "reliable" ST's syntax based folding works in "expected" ways.

That's mainly another example for sublimehq/sublime_text#6065.

As soon as a foldBegin or foldEnd selectors match multiple tokens, ST creates unbalanced sets of folding markers, causing content to fold in unexpected and hard to follow ways.

Needs some investigation to find a solution.

@deathaxe deathaxe added C: syntax Category: syntax definition bug labels Aug 10, 2023
deathaxe added a commit to deathaxe/sublime-packages that referenced this issue Aug 10, 2023
This commit adjusts fenced code block related patterns to scope EOL `meta.fold`,
to provide reliable single char tokens for syntax based folding and adjusts fold
rules accordingly.

Reported at SublimeText-Markdown/MarkdownEditing#733
deathaxe added a commit that referenced this issue Aug 10, 2023
Addresses #733.

This commit changes Markdown.sublime-syntax in order to introduce patterns to
reliably provide fold markers for fenced code blocks.

Note: The changes are not needed for ST3, but are backported to keep syntaxes
      aligned as much as possible.
deathaxe added a commit that referenced this issue Aug 10, 2023
Final step to fix #733.
deathaxe added a commit that referenced this issue Aug 10, 2023
Addresses #733.

This commit changes Markdown.sublime-syntax in order to introduce patterns to
reliably provide fold markers for fenced code blocks.

Note: The changes are not needed for ST3, but are backported to keep syntaxes
      aligned as much as possible.
FichteFoll pushed a commit to sublimehq/Packages that referenced this issue Nov 1, 2023
This commit adjusts fenced code block related patterns to scope EOL `meta.fold`,
to provide reliable single char tokens for syntax based folding and adjusts fold
rules accordingly.

Reported at SublimeText-Markdown/MarkdownEditing#733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug C: syntax Category: syntax definition
Projects
None yet
Development

No branches or pull requests

2 participants