annotate runtime/syntax/context.vim @ 9260:ac8180818504 v7.4.1913

commit https://github.com/vim/vim/commit/1610d052413e0ed664498853a47acc2d677a22d1 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 9 22:53:01 2016 +0200 patch 7.4.1913 Problem: When ":doautocmd" is used modelines are used even when no autocommands were executed. (Daniel Hahler) Solution: Skip processing modelines. (closes https://github.com/vim/vim/issues/854)
author Christian Brabandt <cb@256bit.org>
date Thu, 09 Jun 2016 23:00:05 +0200
parents edc1c9d6dab9
children 07d2b5a3b7cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
1 " Vim syntax file
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
2 " Language: ConTeXt typesetting engine
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
1224
edc1c9d6dab9 updated for version 7.1b
vimboss
parents: 839
diff changeset
4 " Latest Revision: 2006-08-10
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
5
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
6 if exists("b:current_syntax")
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
7 finish
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
8 endif
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
9
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
10 runtime! syntax/plaintex.vim
1224
edc1c9d6dab9 updated for version 7.1b
vimboss
parents: 839
diff changeset
11 unlet b:current_syntax
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
12
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
13 let s:cpo_save = &cpo
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
14 set cpo&vim
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
15
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
16 if !exists('g:context_include')
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
17 let g:context_include = ['mp', 'javascript', 'xml']
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
18 endif
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
19
1224
edc1c9d6dab9 updated for version 7.1b
vimboss
parents: 839
diff changeset
20 syn spell toplevel
edc1c9d6dab9 updated for version 7.1b
vimboss
parents: 839
diff changeset
21
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
22 syn match contextBlockDelim display '\\\%(start\|stop\)\a\+'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
23 \ contains=@NoSpell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
24
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
25 syn region contextEscaped display matchgroup=contextPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
26 \ start='\\type\z(\A\)' end='\z1'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
27 syn region contextEscaped display matchgroup=contextPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
28 \ start='\\type\={' end='}'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
29 syn region contextEscaped display matchgroup=contextPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
30 \ start='\\type\=<<' end='>>'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
31 syn region contextEscaped matchgroup=contextPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
32 \ start='\\start\z(\a*\%(typing\|typen\)\)'
1224
edc1c9d6dab9 updated for version 7.1b
vimboss
parents: 839
diff changeset
33 \ end='\\stop\z1' contains=plaintexComment keepend
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
34 syn region contextEscaped display matchgroup=contextPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
35 \ start='\\\h\+Type{' end='}'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
36 syn region contextEscaped display matchgroup=contextPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
37 \ start='\\Typed\h\+{' end='}'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
38
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
39 syn match contextBuiltin display contains=@NoSpell
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
40 \ '\\\%(unprotect\|protect\|unexpanded\)'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
41
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
42 syn match contextPreProc '^\s*\\\%(start\|stop\)\=\%(component\|environment\|project\|product\).*$'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
43 \ contains=@NoSpell
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
44
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
45 if index(g:context_include, 'mp') != -1
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
46 syn include @mpTop syntax/mp.vim
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
47 unlet b:current_syntax
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
48
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
49 syn region contextMPGraphic transparent matchgroup=contextBlockDelim
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
50 \ start='\\start\z(\a*MPgraphic\|MP\%(page\|inclusions\|run\)\).*'
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
51 \ end='\\stop\z1'
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
52 \ contains=@mpTop
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
53 endif
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
54
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
55 " TODO: also need to implement this for \\typeC or something along those
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
56 " lines.
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
57 function! s:include_syntax(name, group)
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
58 if index(g:context_include, a:name) != -1
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
59 execute 'syn include @' . a:name . 'Top' 'syntax/' . a:name . '.vim'
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
60 unlet b:current_syntax
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
61 execute 'syn region context' . a:group . 'Code'
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
62 \ 'transparent matchgroup=contextBlockDelim'
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
63 \ 'start=+\\start' . a:group . '+ end=+\\stop' . a:group . '+'
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
64 \ 'contains=@' . a:name . 'Top'
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
65 endif
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
66 endfunction
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
67
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
68 call s:include_syntax('c', 'C')
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
69 call s:include_syntax('ruby', 'Ruby')
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
70 call s:include_syntax('javascript', 'JS')
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
71 call s:include_syntax('xml', 'XML')
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
72
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
73 syn match contextSectioning '\\chapter\>' contains=@NoSpell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
74 syn match contextSectioning '\\\%(sub\)*section\>' contains=@NoSpell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
75
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
76 syn match contextSpecial '\\crlf\>\|\\par\>\|-\{2,3}\||[<>/]\=|'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
77 \ contains=@NoSpell
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
78 syn match contextSpecial /\\[`'"]/
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
79 syn match contextSpecial +\\char\%(\d\{1,3}\|'\o\{1,3}\|"\x\{1,2}\)\>+
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
80 \ contains=@NoSpell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
81 syn match contextSpecial '\^\^.'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
82 syn match contextSpecial '`\%(\\.\|\^\^.\|.\)'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
83
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
84 syn match contextStyle '\\\%(em\|ss\|hw\|cg\|mf\)\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
85 \ contains=@NoSpell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
86 syn match contextFont '\\\%(CAP\|Cap\|cap\|Caps\|kap\|nocap\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
87 \ contains=@NoSpell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
88 syn match contextFont '\\\%(Word\|WORD\|Words\|WORDS\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
89 \ contains=@NoSpell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
90 syn match contextFont '\\\%(vi\{1,3}\|ix\|xi\{0,2}\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
91 \ contains=@NoSpell
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
92 syn match contextFont '\\\%(tf\|b[si]\|s[cl]\|os\)\%(xx\|[xabcd]\)\=\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
93 \ contains=@NoSpell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
94
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
95 hi def link contextBlockDelim Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
96 hi def link contextBuiltin Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
97 hi def link contextDelimiter Delimiter
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
98 hi def link contextPreProc PreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
99 hi def link contextSectioning PreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
100 hi def link contextSpecial Special
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
101 hi def link contextType Type
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
102 hi def link contextStyle contextType
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
103 hi def link contextFont contextType
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
104
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
105 let b:current_syntax = "context"
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
106
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
107 let &cpo = s:cpo_save
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
108 unlet s:cpo_save