mirror of
https://github.com/raimon49/requirements.txt.vim.git
synced 2025-12-06 10:04:23 +08:00
Syntax: Add a missing whitespace requirement to comments
Some checks failed
VimScript / test (push) Has been cancelled
Some checks failed
VimScript / test (push) Has been cancelled
According to the spec:
A line that begins with # is treated as a comment and ignored.
Whitespace followed by a # causes the # and the remainder of the line
to be treated as a comment.
Before this patch the following had a mistakenly highlighted
comment (pip doesn't accept this):
numpy==2.1.3#not a comment
(There's no whitespace before the #).
This commit is contained in:
@@ -37,7 +37,7 @@ syn region requirementsSubst matchgroup=requirementsSubstDelim start="\V${" end=
|
|||||||
syn region requirementsString matchgroup=requirementsStringDelim start=`'` skip=`\\'` end=`'`
|
syn region requirementsString matchgroup=requirementsStringDelim start=`'` skip=`\\'` end=`'`
|
||||||
syn region requirementsString matchgroup=requirementsStringDelim start=`"` skip=`\\"` end=`"`
|
syn region requirementsString matchgroup=requirementsStringDelim start=`"` skip=`\\"` end=`"`
|
||||||
syn match requirementsVersion "\v\d+[a-zA-Z0-9\.\-\*]*"
|
syn match requirementsVersion "\v\d+[a-zA-Z0-9\.\-\*]*"
|
||||||
syn region requirementsComment start="[ \t]*#" end="$"
|
syn region requirementsComment start="\v(^|[ \t])#" end="$"
|
||||||
syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
|
syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
|
||||||
syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)"
|
syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)"
|
||||||
syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])"
|
syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])"
|
||||||
|
|||||||
Reference in New Issue
Block a user