Package: vim
Version: 1:7.1.314-3+lenny2
Severity: minor
Tags: patch

vim's syntax highlighting for crontabs breaks if a day or month name is
specified with a capital letter, e.g:

* * * * Mon-Fri mycommand

However, cron seems to treat these values as case-insensitive. The
attached patch fixes this by adding "syntax case ignore" before the
syntax.

Conversely, the @foo special time specifiers (e.g. "@reboot", "@hourly")
ARE case-sensitive. The patch also defines the syntax so that the
incorrect case is displayed as an error, with the correct case displayed
as before.

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-openvz-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages vim depends on:
ii  libacl1               2.2.47-2           Access control list shared library
ii  libc6                 2.7-18lenny2       GNU C Library: Shared libraries
ii  libgpm2               1.20.4-3.1         General Purpose Mouse - shared lib
ii  libncurses5           5.7+20081213-1     shared libraries for terminal hand
ii  libselinux1           2.0.65-5           SELinux shared libraries
ii  vim-common            1:7.1.314-3+lenny2 Vi IMproved - Common files
ii  vim-runtime           1:7.1.314-3+lenny2 Vi IMproved - Runtime files

vim recommends no packages.

Versions of packages vim suggests:
ii  exuberant-ctags [ctags]       1:5.7-4    build tag file indexes of source c
pn  vim-doc                       <none>     (no description available)
ii  vim-scripts                   20080722-1 plugins for vim, adding bells and 

-- no debconf information

-- 
Chris Butler <[email protected]>
  GnuPG Key ID: 1024D/D097A261
--- /usr/share/vim/vimcurrent/syntax/crontab.vim	2009-03-19 15:31:04.000000000 +0000
+++ .vim/syntax/crontab.vim	2010-02-04 11:27:08.000000000 +0000
@@ -23,6 +23,8 @@
 syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
 syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
 
+" month and day name matches are case insensitive
+syntax case ignore
 syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained
 syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
 
@@ -33,6 +35,11 @@
 syntax match crontabCmnt "^\s*#.*"
 syntax match crontabPercent "[^\\]%.*"lc=1 contained
 
+" special time specifiers are case sensitive - display as an error if the case is wrong
+syntax match crontabNickError "^...@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
+
+syntax case match
+" overrides the above with the correct case
 syntax match crontabNick "^...@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
 
 syntax match crontabVar "^\s*\k\w*\s*="me=e-1
@@ -62,6 +69,7 @@
   HiLink crontabDowS		PreProc
   HiLink crontabDowN		PreProc
 
+  HiLink crontabNickError	Error
   HiLink crontabNick		Special
   HiLink crontabVar		Identifier
   HiLink crontabPercent		Special

Reply via email to