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

Fix whitespace in negative charclasses #331

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Conversation

silby
Copy link
Contributor

@silby silby commented Dec 16, 2024

In vim patterns, \s inside a "collection" matches literal s, not space-or-tab. Buried in :help collection is this factoid:

NOTE: The other backslash codes mentioned above do not work inside
[]!

So before this fix, _something_ wouldn't start an emphasis at the first underscore because the pattern for the syntax region required underscore not-followed-by s. This diff replaces \s inside square bracket patterns with [:blank:], which is a character class expression for "space or tab".

In vim patterns, `\s` inside a "collection" matches literal s, not
space-or-tab. Buried in `:help collection` is this factoid:

    NOTE: The other backslash codes mentioned above do not work inside
    []!

So before this fix, `_something_` wouldn't start an emphasis at the first
underscore because the pattern for the syntax region required underscore
not-followed-by `s`. This diff replaces `\s` inside square bracket
patterns with `[:blank:]`, which is a character class expression for
"space or tab".
@jgm jgm merged commit f7e12e9 into jgm:main Dec 17, 2024
@jgm
Copy link
Owner

jgm commented Dec 17, 2024

Thanks!

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.

2 participants