Mercurial > ec-dotfiles
diff vendor/vim-syntax/json.vim @ 629:035b23bb15da
Update syntaxes
author | nanaya <me@nanaya.pro> |
---|---|
date | Fri, 18 Oct 2019 15:21:13 +0900 |
parents | 0e72765944d4 |
children | 78469331407e |
line wrap: on
line diff
--- a/vendor/vim-syntax/json.vim Sun Jun 30 20:31:45 2019 +0900 +++ b/vendor/vim-syntax/json.vim Fri Oct 18 15:21:13 2019 +0900 @@ -1,7 +1,8 @@ " Vim syntax file " Language: JSON -" Maintainer: Eli Parra <eli@elzr.com> -" Last Change: 2014 Aug 23 +" Maintainer: vacancy +" Previous Maintainer: Eli Parra <eli@elzr.com> +" Last Change: 2019 Sep 17 " Version: 0.12 if !exists("main_syntax") @@ -16,10 +17,21 @@ " NOTE that for the concealing to work your conceallevel should be set to 2 +" 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') && (!exists("g:vim_json_conceal") || g:vim_json_conceal==1) + 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]*\:/ contained +endif + " Syntax: Strings " Separated into a match and region because a region by itself is always greedy +" Needs to come after keywords or else a json encoded string will break the +" syntax syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString -if has('conceal') +if has('conceal') && (!exists("g:vim_json_conceal") || g:vim_json_conceal==1) 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 @@ -28,14 +40,6 @@ " Syntax: JSON does not allow strings with single quotes, unlike JavaScript. syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+ -" 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') - 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]*\:/ contained -endif " Syntax: Escape sequences syn match jsonEscape "\\["\\/bfnrt]" contained