annotate runtime/syntax/slrnsc.vim @ 4916:ba328b4a990e v7.3.1203

updated for version 7.3.1203 Problem: Matches from matchadd() might be highlighted incorrectly when they are at a fixed position and inserting lines. (John Szakmeister) Solution: Redraw all lines below a change if there are highlighted matches. (idea by Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Sat, 15 Jun 2013 23:00:30 +0200
parents ac33b7c03fac
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Slrn score file (based on slrn 0.9.8.0)
29
ac33b7c03fac updated for version 7.0018
vimboss
parents: 7
diff changeset
3 " Maintainer: Preben 'Peppe' Guldberg <peppe@wielders.org>
ac33b7c03fac updated for version 7.0018
vimboss
parents: 7
diff changeset
4 " Last Change: 8 Oct 2004
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " characters in newsgroup names
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 set isk=@,48-57,.,-,_,+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 setlocal isk=@,48-57,.,-,_,+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match slrnscComment "%.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match slrnscSectionCom ".].*"lc=2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match slrnscGroup contained "\(\k\|\*\)\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match slrnscNumber contained "\d\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match slrnscDate contained "\(\d\{1,2}[-/]\)\{2}\d\{4}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match slrnscDelim contained ":"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match slrnscComma contained ","
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match slrnscOper contained "\~"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match slrnscEsc contained "\\[ecC<>.]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match slrnscEsc contained "[?^]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match slrnscEsc contained "[^\\]$\s*$"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword slrnscInclude contained include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match slrnscIncludeLine "^\s*Include\s\+\S.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn region slrnscSection matchgroup=slrnscSectionStd start="^\s*\[" end='\]' contains=slrnscGroup,slrnscComma,slrnscSectionCom
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn region slrnscSection matchgroup=slrnscSectionNot start="^\s*\[\~" end='\]' contains=slrnscGroup,slrnscCommas,slrnscSectionCom
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword slrnscItem contained Age Bytes Date Expires From Has-Body Lines Message-Id Newsgroup References Subject Xref
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match slrnscScoreItem contained "%.*$" skipempty nextgroup=slrnscScoreItem contains=slrnscComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match slrnscScoreItem contained "^\s*Expires:\s*\(\d\{1,2}[-/]\)\{2}\d\{4}\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscItem,slrnscDelim,slrnscDate
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match slrnscScoreItem contained "^\s*\~\=\(Age\|Bytes\|Has-Body\|Lines\):\s*\d\+\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscOper,slrnscItem,slrnscDelim,slrnscNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match slrnscScoreItemFill contained ".*$" skipempty nextgroup=slrnscScoreItem contains=slrnscEsc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match slrnscScoreItem contained "^\s*\~\=\(Date\|From\|Message-Id\|Newsgroup\|References\|Subject\|Xref\):" nextgroup=slrnscScoreItemFill contains=slrnscOper,slrnscItem,slrnscDelim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn region slrnscScoreItem contained matchgroup=Special start="^\s*\~\={::\=" end="^\s*}" skipempty nextgroup=slrnscScoreItem contains=slrnscScoreItem
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword slrnscScore contained Score
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match slrnscScoreIdent contained "%.*"
29
ac33b7c03fac updated for version 7.0018
vimboss
parents: 7
diff changeset
51 syn match slrnScoreLine "^\s*Score::\=\s\+=\=[-+]\=\d\+\s*\(%.*\)\=$" skipempty nextgroup=slrnscScoreItem contains=slrnscScore,slrnscDelim,slrnscOper,slrnscNumber,slrnscScoreIdent
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 if version >= 508 || !exists("did_slrnsc_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 let did_slrnsc_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 HiLink slrnscComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 HiLink slrnscSectionCom slrnscComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 HiLink slrnscGroup String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 HiLink slrnscNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink slrnscDate Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink slrnscDelim Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink slrnscComma SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink slrnscOper SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 HiLink slrnscEsc String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink slrnscSectionStd Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink slrnscSectionNot Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 HiLink slrnscItem Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HiLink slrnscScore Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 HiLink slrnscScoreIdent Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink slrnscInclude Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 let b:current_syntax = "slrnsc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 "EOF vim: ts=8 noet tw=200 sw=8 sts=0