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 commitsmaster3dc0e23e
anddc9c40a5
, 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 commitec8d51be
, six years ago.)
parent
9b419d0bff
commit
e52c81f5db
|
@ -1,6 +1,6 @@
|
|||
## Syntax highlighting for nanorc files.
|
||||
|
||||
syntax nanorc "\.?nanorc(\.in)?$"
|
||||
syntax nanorc "[/.]nanorc(\.in)?$"
|
||||
comment "#"
|
||||
|
||||
# Everything that does not get recolored is invalid
|
||||
|
|
Loading…
Reference in New Issue