Mercurial > vim
comparison runtime/syntax/json.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 | babc6a1d4c27 |
children | 46763b01cd9a |
comparison
equal
deleted
inserted
replaced
10047:a62862410ca1 | 10048:43efa4f5a8ea |
---|---|
3 " Maintainer: Eli Parra <eli@elzr.com> | 3 " Maintainer: Eli Parra <eli@elzr.com> |
4 " Last Change: 2014 Aug 23 | 4 " Last Change: 2014 Aug 23 |
5 " Version: 0.12 | 5 " Version: 0.12 |
6 | 6 |
7 if !exists("main_syntax") | 7 if !exists("main_syntax") |
8 if version < 600 | 8 " quit when a syntax file was already loaded |
9 syntax clear | 9 if exists("b:current_syntax") |
10 elseif exists("b:current_syntax") | |
11 finish | 10 finish |
12 endif | 11 endif |
13 let main_syntax = 'json' | 12 let main_syntax = 'json' |
14 endif | 13 endif |
15 | 14 |
91 " Syntax: Braces | 90 " Syntax: Braces |
92 syn region jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold | 91 syn region jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold |
93 syn region jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold | 92 syn region jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold |
94 | 93 |
95 " Define the default highlighting. | 94 " Define the default highlighting. |
96 " For version 5.7 and earlier: only when not done already | 95 " Only when an item doesn't have highlighting yet |
97 " For version 5.8 and later: only when an item doesn't have highlighting yet | 96 command -nargs=+ HiLink hi def link <args> |
98 if version >= 508 || !exists("did_json_syn_inits") | 97 HiLink jsonPadding Operator |
99 if version < 508 | 98 HiLink jsonString String |
100 let did_json_syn_inits = 1 | 99 HiLink jsonTest Label |
101 command -nargs=+ HiLink hi link <args> | 100 HiLink jsonEscape Special |
102 else | 101 HiLink jsonNumber Number |
103 command -nargs=+ HiLink hi def link <args> | 102 HiLink jsonBraces Delimiter |
104 endif | 103 HiLink jsonNull Function |
105 HiLink jsonPadding Operator | 104 HiLink jsonBoolean Boolean |
106 HiLink jsonString String | 105 HiLink jsonKeyword Label |
107 HiLink jsonTest Label | |
108 HiLink jsonEscape Special | |
109 HiLink jsonNumber Number | |
110 HiLink jsonBraces Delimiter | |
111 HiLink jsonNull Function | |
112 HiLink jsonBoolean Boolean | |
113 HiLink jsonKeyword Label | |
114 | 106 |
115 if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1) | 107 if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1) |
116 HiLink jsonNumError Error | 108 HiLink jsonNumError Error |
117 HiLink jsonCommentError Error | 109 HiLink jsonCommentError Error |
118 HiLink jsonSemicolonError Error | 110 HiLink jsonSemicolonError Error |
119 HiLink jsonTrailingCommaError Error | 111 HiLink jsonTrailingCommaError Error |
120 HiLink jsonMissingCommaError Error | 112 HiLink jsonMissingCommaError Error |
121 HiLink jsonStringSQError Error | 113 HiLink jsonStringSQError Error |
122 HiLink jsonNoQuotesError Error | 114 HiLink jsonNoQuotesError Error |
123 HiLink jsonTripleQuotesError Error | 115 HiLink jsonTripleQuotesError Error |
124 endif | |
125 HiLink jsonQuote Quote | |
126 HiLink jsonNoise Noise | |
127 delcommand HiLink | |
128 endif | 116 endif |
117 HiLink jsonQuote Quote | |
118 HiLink jsonNoise Noise | |
119 delcommand HiLink | |
129 | 120 |
130 let b:current_syntax = "json" | 121 let b:current_syntax = "json" |
131 if main_syntax == 'json' | 122 if main_syntax == 'json' |
132 unlet main_syntax | 123 unlet main_syntax |
133 endif | 124 endif |