Skip to content

[Python] Extend comment punctuation#4438

Merged
deathaxe merged 3 commits intosublimehq:masterfrom
deathaxe:pr/python/comments
Mar 3, 2026
Merged

[Python] Extend comment punctuation#4438
deathaxe merged 3 commits intosublimehq:masterfrom
deathaxe:pr/python/comments

Conversation

@deathaxe
Copy link
Collaborator

@deathaxe deathaxe commented Feb 7, 2026

This commit copes all leading and trailing # signs in comments punctuation.definition.comment to...

  1. ensure ST's enter key to work as expected in case of comments starting with multiple ##
  2. ensure same highlighting of all leading # signs. Even though, technically only the first # defines the comment, highlighting all the same just looks more consistent.
  3. (2) also applies to trailing #. Despite not having a semantic meaning, separating comments just look more consistent with trailing # scoped punctuation.

Before

grafik

After

grafik

This commit copes all leading and trailing # signs in comments
`punctuation.definition.comment` to...

1. ensure ST's enter key to work as expected in case of comments
   starting with multiple ##
2. ensure same highlighting of all leading # signs. Even though, technically
   only the first # defines the comment, highlighting all the same just looks
   more consistent.
3. (2) also applies to trailing #. Despite not having a semantic meaning,
   separating comments just look more consistent with trailing # scoped
   punctuation.
`expressions-in-a-statement` context is terminated by comments.
Thus including patterns to consume them is redundant.
michaelblyons
michaelblyons previously approved these changes Feb 25, 2026
Copy link
Collaborator

@michaelblyons michaelblyons left a comment

Choose a reason for hiding this comment

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

I think this is fine, but I would understand objections to it.

FichteFoll
FichteFoll previously approved these changes Mar 1, 2026
@deathaxe deathaxe dismissed stale reviews from FichteFoll and michaelblyons via 7ada3a9 March 2, 2026 16:52
@deathaxe deathaxe merged commit 95ee065 into sublimehq:master Mar 3, 2026
2 checks passed
@deathaxe deathaxe deleted the pr/python/comments branch March 3, 2026 16:57
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