summaryrefslogtreecommitdiff
path: root/runtime/syntax/json.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-30 23:26:57 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-30 23:26:57 +0200
commit89bcfda6834aba724d12554a34b9ed49f5789fd5 (patch)
tree2ffddcadaae9d061e38e17a09b2635ec199eb1dd /runtime/syntax/json.vim
parent4792255eff03760dca0fd014616532e6d47db364 (diff)
downloadvim-89bcfda6834aba724d12554a34b9ed49f5789fd5.zip
Updated runtime files. Remove version checks for Vim older than 6.0.
Diffstat (limited to 'runtime/syntax/json.vim')
-rw-r--r--runtime/syntax/json.vim61
1 files changed, 26 insertions, 35 deletions
diff --git a/runtime/syntax/json.vim b/runtime/syntax/json.vim
index 1fdfea2d0..34c26d37d 100644
--- a/runtime/syntax/json.vim
+++ b/runtime/syntax/json.vim
@@ -5,9 +5,8 @@
" Version: 0.12
if !exists("main_syntax")
- if version < 600
- syntax clear
- elseif exists("b:current_syntax")
+ " quit when a syntax file was already loaded
+ if exists("b:current_syntax")
finish
endif
let main_syntax = 'json'
@@ -93,39 +92,31 @@ syn region jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\
syn region jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold
" Define the default highlighting.
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508 || !exists("did_json_syn_inits")
- if version < 508
- let did_json_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
- HiLink jsonPadding Operator
- HiLink jsonString String
- HiLink jsonTest Label
- HiLink jsonEscape Special
- HiLink jsonNumber Number
- HiLink jsonBraces Delimiter
- HiLink jsonNull Function
- HiLink jsonBoolean Boolean
- HiLink jsonKeyword Label
-
- if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
- HiLink jsonNumError Error
- HiLink jsonCommentError Error
- HiLink jsonSemicolonError Error
- HiLink jsonTrailingCommaError Error
- HiLink jsonMissingCommaError Error
- HiLink jsonStringSQError Error
- HiLink jsonNoQuotesError Error
- HiLink jsonTripleQuotesError Error
- endif
- HiLink jsonQuote Quote
- HiLink jsonNoise Noise
- delcommand HiLink
+" Only when an item doesn't have highlighting yet
+command -nargs=+ HiLink hi def link <args>
+HiLink jsonPadding Operator
+HiLink jsonString String
+HiLink jsonTest Label
+HiLink jsonEscape Special
+HiLink jsonNumber Number
+HiLink jsonBraces Delimiter
+HiLink jsonNull Function
+HiLink jsonBoolean Boolean
+HiLink jsonKeyword Label
+
+if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
+HiLink jsonNumError Error
+HiLink jsonCommentError Error
+HiLink jsonSemicolonError Error
+HiLink jsonTrailingCommaError Error
+HiLink jsonMissingCommaError Error
+HiLink jsonStringSQError Error
+HiLink jsonNoQuotesError Error
+HiLink jsonTripleQuotesError Error
endif
+HiLink jsonQuote Quote
+HiLink jsonNoise Noise
+delcommand HiLink
let b:current_syntax = "json"
if main_syntax == 'json'