Mercurial > vim
comparison runtime/syntax/cweb.vim @ 10048:43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 30 23:26:57 2016 +0200
Updated runtime files. Remove version checks for Vim older than 6.0.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 30 Aug 2016 23:30:09 +0200 |
parents | 91e53bcb7946 |
children | 46763b01cd9a |
comparison
equal
deleted
inserted
replaced
10047:a62862410ca1 | 10048:43efa4f5a8ea |
---|---|
11 " TODO: Section names and C/C++ comments should be treated as TeX material. | 11 " TODO: Section names and C/C++ comments should be treated as TeX material. |
12 " TODO: The current version switches syntax highlighting off for section | 12 " TODO: The current version switches syntax highlighting off for section |
13 " TODO: names, and leaves C/C++ comments as such. (On the other hand, | 13 " TODO: names, and leaves C/C++ comments as such. (On the other hand, |
14 " TODO: switching to TeX mode in C/C++ comments might be colour overkill.) | 14 " TODO: switching to TeX mode in C/C++ comments might be colour overkill.) |
15 | 15 |
16 " For version 5.x: Clear all syntax items | 16 " quit when a syntax file was already loaded |
17 " For version 6.x: Quit when a syntax file was already loaded | 17 if exists("b:current_syntax") |
18 if version < 600 | |
19 syntax clear | |
20 elseif exists("b:current_syntax") | |
21 finish | 18 finish |
22 endif | 19 endif |
23 | 20 |
24 " For starters, read the TeX syntax; TeX syntax items are allowed at the top | 21 " For starters, read the TeX syntax; TeX syntax items are allowed at the top |
25 " level in the CWEB syntax, e.g., in the preamble. In general, a CWEB source | 22 " level in the CWEB syntax, e.g., in the preamble. In general, a CWEB source |
26 " code can be seen as a normal TeX document with some C/C++ material | 23 " code can be seen as a normal TeX document with some C/C++ material |
27 " interspersed in certain defined regions. | 24 " interspersed in certain defined regions. |
28 if version < 600 | 25 runtime! syntax/tex.vim |
29 source <sfile>:p:h/tex.vim | 26 unlet b:current_syntax |
30 else | |
31 runtime! syntax/tex.vim | |
32 unlet b:current_syntax | |
33 endif | |
34 | 27 |
35 " Read the C/C++ syntax too; C/C++ syntax items are treated as such in the | 28 " Read the C/C++ syntax too; C/C++ syntax items are treated as such in the |
36 " C/C++ section of a CWEB chunk or in inner C/C++ context in "|...|" groups. | 29 " C/C++ section of a CWEB chunk or in inner C/C++ context in "|...|" groups. |
37 syntax include @webIncludedC <sfile>:p:h/cpp.vim | 30 syntax include @webIncludedC <sfile>:p:h/cpp.vim |
38 | 31 |
61 " Double-@ means single-@, anywhere in the CWEB source. (This allows e-mail | 54 " Double-@ means single-@, anywhere in the CWEB source. (This allows e-mail |
62 " address <someone@@fsf.org> without going into C/C++ mode.) | 55 " address <someone@@fsf.org> without going into C/C++ mode.) |
63 syntax match webIgnoredStuff "@@" | 56 syntax match webIgnoredStuff "@@" |
64 | 57 |
65 " Define the default highlighting. | 58 " Define the default highlighting. |
66 " For version 5.7 and earlier: only when not done already | 59 " Only when an item doesn't have highlighting yet |
67 " For version 5.8 and later: only when an item doesn't have highlighting yet | 60 command -nargs=+ HiLink hi def link <args> |
68 if version >= 508 || !exists("did_cweb_syntax_inits") | |
69 if version < 508 | |
70 let did_cweb_syntax_inits = 1 | |
71 command -nargs=+ HiLink hi link <args> | |
72 else | |
73 command -nargs=+ HiLink hi def link <args> | |
74 endif | |
75 | 61 |
76 HiLink webRestrictedTeX String | 62 HiLink webRestrictedTeX String |
77 | 63 |
78 delcommand HiLink | 64 delcommand HiLink |
79 endif | |
80 | 65 |
81 let b:current_syntax = "cweb" | 66 let b:current_syntax = "cweb" |
82 | 67 |
83 let &cpo = s:cpo_save | 68 let &cpo = s:cpo_save |
84 unlet s:cpo_save | 69 unlet s:cpo_save |