Skip to content

Conversation

@deathaxe
Copy link
Collaborator

This PR...

  1. fixes an issue which causes multiple subsequent reference definitions to be listed as one item in Goto Symbol quick panel.

    Meta scopes of subsequent reference definitions are separated by excluding each definition's final linefeed from meta.link.reference.def scopes, so ST sees them as separate regions.

    Implementation requires branching to overcome ST's line blindness, first pushing a context to check next line's content. In case of required termination, context is rolled back to current line's eol before popping its context. That's quite some song and dance, but there's no other solution.

  2. aligns reference definitions' implementations in block quotes and other paragraphs, so they exactly match with regards to features and structure.

  3. removes possible block quote punctuation from symbols.

Example

## Heading 

This is [base][url] and a [^1].

[base]: #base
[url]: #version-url-date
[^1]: footnot 1
[^2]: footnot 2
Before
grafik

Parsing syntax_test_markdown.markdown takes 35ms

After

grafik

Parsing syntax_test_markdown.markdown takes 38ms

deathaxe added 2 commits July 31, 2025 17:09
This commit...

1. fixes an issue which causes multiple subsequent reference
   definitions to be listed as one item in Goto Symbol quick panel.

   Meta scopes of subsequent reference definitions are separated by excluding
   each definition's final linefeed from `meta.link.reference.def` scopes,
   so ST sees them as separate regions.

   Implementation requires branching to overcome ST's line blindness,
   first pushing a context to check next line's content. In case of required
   termination, context is rolled back to current line's eol before popping
   its context. That's quite some song and dance, but there's no other solution.

2. aligns reference definitions' implementations in block quotes and other
   paragraphs, so they exactly match with regards to features and structure.

3. removes possible block quote punctuation from symbols.
scope: invalid.illegal.expected-eol.markdown

immediately-pop:
- meta_include_prototype: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice catch

@deathaxe deathaxe merged commit a2af397 into sublimehq:master Aug 5, 2025
2 checks passed
@deathaxe deathaxe deleted the pr/markdown/fix-reference-symbols branch August 5, 2025 09:49
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