diff vendor/vim-syntax/json.vim @ 589:7fbadf8bd22e

Update vendor Change whatever available from official vim
author nanaya <me@myconan.net>
date Thu, 07 Jul 2016 15:59:06 +0900
parents 6f57f959cc0b
children 0e72765944d4
line wrap: on
line diff
--- a/vendor/vim-syntax/json.vim	Sun Jun 26 15:08:01 2016 +0900
+++ b/vendor/vim-syntax/json.vim	Thu Jul 07 15:59:06 2016 +0900
@@ -1,11 +1,8 @@
 " Vim syntax file
 " Language:	JSON
-" Maintainer:	Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
-" Last Change:	2014-12-20 Load ftplugin/json.vim
-
-" Reload the definition of g:vim_json_syntax_conceal
-" see https://github.com/elzr/vim-json/issues/42
-runtime! ftplugin/json.vim
+" Maintainer:	Eli Parra <eli@elzr.com>
+" Last Change:	2014 Aug 23
+" Version:      0.12
 
 if !exists("main_syntax")
   if version < 600
@@ -23,7 +20,7 @@
 " Syntax: Strings
 " Separated into a match and region because a region by itself is always greedy
 syn match  jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
-if has('conceal') && g:vim_json_syntax_conceal == 1
+if has('conceal')
 	syn region  jsonString oneline matchgroup=jsonQuote start=/"/  skip=/\\\\\|\\"/  end=/"/ concealends contains=jsonEscape contained
 else
 	syn region  jsonString oneline matchgroup=jsonQuote start=/"/  skip=/\\\\\|\\"/  end=/"/ contains=jsonEscape contained
@@ -35,10 +32,10 @@
 " Syntax: JSON Keywords
 " Separated into a match and region because a region by itself is always greedy
 syn match  jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
-if has('conceal') && g:vim_json_syntax_conceal == 1
-   syn region  jsonKeyword matchgroup=jsonQuote start=/"/  end=/"\ze[[:blank:]\r\n]*\:/ concealends contains=jsonEscape contained
+if has('conceal')
+   syn region  jsonKeyword matchgroup=jsonQuote start=/"/  end=/"\ze[[:blank:]\r\n]*\:/ concealends contained
 else
-   syn region  jsonKeyword matchgroup=jsonQuote start=/"/  end=/"\ze[[:blank:]\r\n]*\:/ contains=jsonEscape contained
+   syn region  jsonKeyword matchgroup=jsonQuote start=/"/  end=/"\ze[[:blank:]\r\n]*\:/ contained
 endif
 
 " Syntax: Escape sequences
@@ -96,29 +93,38 @@
 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")
-  hi def link jsonPadding		Operator
-  hi def link jsonString		String
-  hi def link jsonTest			Label
-  hi def link jsonEscape		Special
-  hi def link jsonNumber		Delimiter
-  hi def link jsonBraces		Delimiter
-  hi def link jsonNull			Function
-  hi def link jsonBoolean		Delimiter
-  hi def link jsonKeyword		Label
+  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)
-		hi def link jsonNumError					Error
-		hi def link jsonCommentError				Error
-		hi def link jsonSemicolonError			Error
-		hi def link jsonTrailingCommaError		Error
-		hi def link jsonMissingCommaError		Error
-		hi def link jsonStringSQError				Error
-		hi def link jsonNoQuotesError				Error
-		hi def link jsonTripleQuotesError		Error
+	  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
-  hi def link jsonQuote			Quote
-  hi def link jsonNoise			Noise
+  HiLink jsonQuote           Quote
+  HiLink jsonNoise           Noise
+  delcommand HiLink
 endif
 
 let b:current_syntax = "json"