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

[Batch File] Fix comment scope around newlines #3992

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

mataha
Copy link
Contributor

@mataha mataha commented Jun 17, 2024

Multiple colons immediately followed by a non-empty line cause said line
to be scoped as a comment:

::: Set some variables
:::
set WSL_UTF8=1

@mataha mataha force-pushed the fix/batch/empty-line-continuation branch 4 times, most recently from 2b35efd to ccbb91f Compare June 18, 2024 18:12
Multiple colons immediately followed by a non-empty line cause said line
to be scoped as a comment:

    ::: Set some variables
    :::
    set WSL_UTF8=1
@mataha mataha force-pushed the fix/batch/empty-line-continuation branch from ccbb91f to c0d0d90 Compare June 19, 2024 18:17
@mataha
Copy link
Contributor Author

mataha commented Jun 19, 2024

This PR has gotten quite unwieldy, so I've limited it to newline continuations only.

@mataha mataha marked this pull request as ready for review June 19, 2024 23:32
@deathaxe
Copy link
Collaborator

That's not true. How did you come to that conclusion?

Well, just by playing trick on my self with a test script and "trim_trailing_white_space_on_save" setting being true, which removed it without me noticing it 🤣 .

deathaxe added a commit to deathaxe/sublime-packages that referenced this pull request Jun 20, 2024
This commit fixes "label comment" related patterns, to only scope leading
colons `punctuation.definition.comment`.

Label comments make use of invalid labels being ignored.
A label is invalid, if the first character after leading colon is a "metachar".

A label starting with `::` is already an invalid label and thus can be followed
by any (meta) char to still be a "valid" comment.

The wrong pattern was the real reason for the issue addressed by PR sublimehq#3992.
@deathaxe deathaxe merged commit 23c715e into sublimehq:master Jun 22, 2024
4 checks passed
deathaxe added a commit to deathaxe/sublime-packages that referenced this pull request Jun 22, 2024
This commit fixes "label comment" related patterns, to only scope leading
colons `punctuation.definition.comment`.

Label comments make use of invalid labels being ignored.
A label is invalid, if the first character after leading colon is a "metachar".

A label starting with `::` is already an invalid label and thus can be followed
by any (meta) char to still be a "valid" comment.

The wrong pattern was the real reason for the issue addressed by PR sublimehq#3992.
@mataha mataha deleted the fix/batch/empty-line-continuation branch June 25, 2024 19:10
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.

5 participants