syntax: nanorc: improve the file-matching regex
The "\.?" part was pointless. It says that the string "nanorc" *might* be preceded with a period. Sure, but if the period is absent, then anything else may be there too, so the optional period gives zero restriction. The restriction should be: either the filename has the extension ".nanorc" OR the full filename is "nanorc". So the "nanorc" part must be preceded by either a period or a slash. (However, in the times of commits 3dc0e23e and dc9c40a5, fifteen and eighteen years ago, it was still the user-provided filename that was matched against the regex, not the full-path filename. The latter method arrived in commit ec8d51be, six years ago.)
This commit is contained in:
parent
9b419d0bff
commit
e52c81f5db
@ -1,6 +1,6 @@
|
|||||||
## Syntax highlighting for nanorc files.
|
## Syntax highlighting for nanorc files.
|
||||||
|
|
||||||
syntax nanorc "\.?nanorc(\.in)?$"
|
syntax nanorc "[/.]nanorc(\.in)?$"
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
# Everything that does not get recolored is invalid
|
# Everything that does not get recolored is invalid
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user