r1067 - /trunk/runtime/syntax/debcontrol.vim

madduck at users.alioth.debian.org madduck at users.alioth.debian.org
Sun Oct 14 15:26:34 UTC 2007


Author: madduck
Date: Sun Oct 14 15:26:33 2007
New Revision: 1067

URL: http://svn.debian.org/wsvn/?sc=1&rev=1067
Log:
make Vcs-* and Homepage field accept URLs only

Modified:
    trunk/runtime/syntax/debcontrol.vim

Modified: trunk/runtime/syntax/debcontrol.vim
URL: http://svn.debian.org/wsvn/trunk/runtime/syntax/debcontrol.vim?rev=1067&op=diff
==============================================================================
--- trunk/runtime/syntax/debcontrol.vim (original)
+++ trunk/runtime/syntax/debcontrol.vim Sun Oct 14 15:26:33 2007
@@ -32,6 +32,11 @@
 syn match debcontrolPackageType contained "u\?deb"
 syn match debcontrolVariable contained "\${.\{-}}"
 
+" A URL, right now only enforce protocol and some sanity on the server/path
+" part; TODO: debcontrolHTTPUrl somehow is not being matched at all.
+syn match debcontrolUrl contained "\v[+[:alpha:]]+://\a+\.[-_.[:alnum:]]{2,}(:\d+)?(/[^[:space:]]*)?$"
+syn match debcontrolHTTPUrl contained "\vhttps?://\a+\.[-_.[:alnum:]]{2,}(:\d+)?(/[^[:space:]]*)?$"
+
 " An email address
 syn match	debcontrolEmail	"[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"
 syn match	debcontrolEmail	"<.\{-}>"
@@ -45,12 +50,15 @@
 syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline
 syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline
 syn region debcontrolStrictField start="^XC-Package-Type" end="$" contains=debcontrolKey,debcontrolPackageType oneline
+syn region debcontrolStrictField start="^Homepage" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline
+syn region debcontrolStrictField start="^\(XS-\)\?Vcs-\a\+" end="$" contains=debcontrolKey,debcontrolUrl oneline
+syn region debcontrolStrictField start="^\(XS-\)\?Vcs-Browser" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline
 
 " #-Comments
 syn match debcontrolComment "^#.*$"
 
 " Catch-all for the other legal fields
-syn region debcontrolField start="^\(Maintainer\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Bugs\|Origin\|Enhances\|X\(S\|B\)-Python-Version\|Homepage\|\(XS-\)\=Vcs-\a\+\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
+syn region debcontrolField start="^\(Maintainer\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Bugs\|Origin\|Enhances\|X\(S\|B\)-Python-Version\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
 syn region debcontrolMultiField start="^\(Uploaders\|Description\):" skip="^ " end="^$"me=s-1 end="^[^ ]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable
 
 " Associate our matches and regions with pretty colours
@@ -73,6 +81,8 @@
   HiLink debcontrolPackageType	Normal
   HiLink debcontrolVariable	Identifier
   HiLink debcontrolEmail	Identifier
+  HiLink debcontrolUrl		Identifier
+  HiLink debcontrolHTTPUrl	Identifier
   HiLink debcontrolComment	Comment
   HiLink debcontrolElse		Special
 




More information about the pkg-vim-maintainers mailing list