comparison runtime/syntax/json.vim @ 18130:1e5672da6a69

Updte runtime files Commit: https://github.com/vim/vim/commit/589edb340454e7f1b19358f129287a636d53d0e1 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 20 14:38:13 2019 +0200 Updte runtime files
author Bram Moolenaar <Bram@vim.org>
date Fri, 20 Sep 2019 14:45:05 +0200
parents b9bc47742df6
children f8185637a051
comparison
equal deleted inserted replaced
18129:52078b0635f7 18130:1e5672da6a69
1 " Vim syntax file 1 " Vim syntax file
2 " Language: JSON 2 " Language: JSON
3 " Maintainer: vacancy 3 " Maintainer: vacancy
4 " Previous Maintainer: Eli Parra <eli@elzr.com> 4 " Previous Maintainer: Eli Parra <eli@elzr.com>
5 " Last Change: 2019 Jul 08 5 " Last Change: 2019 Sep 17
6 " Version: 0.12 6 " Version: 0.12
7 7
8 if !exists("main_syntax") 8 if !exists("main_syntax")
9 " quit when a syntax file was already loaded 9 " quit when a syntax file was already loaded
10 if exists("b:current_syntax") 10 if exists("b:current_syntax")
18 " NOTE that for the concealing to work your conceallevel should be set to 2 18 " NOTE that for the concealing to work your conceallevel should be set to 2
19 19
20 " Syntax: JSON Keywords 20 " Syntax: JSON Keywords
21 " Separated into a match and region because a region by itself is always greedy 21 " Separated into a match and region because a region by itself is always greedy
22 syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword 22 syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
23 if has('conceal') 23 if has('conceal') && (!exists("g:vim_json_conceal") || g:vim_json_conceal==1)
24 syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contained 24 syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contained
25 else 25 else
26 syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contained 26 syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contained
27 endif 27 endif
28 28
29 " Syntax: Strings 29 " Syntax: Strings
30 " Separated into a match and region because a region by itself is always greedy 30 " Separated into a match and region because a region by itself is always greedy
31 " Needs to come after keywords or else a json encoded string will break the 31 " Needs to come after keywords or else a json encoded string will break the
32 " syntax 32 " syntax
33 syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString 33 syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
34 if has('conceal') 34 if has('conceal') && (!exists("g:vim_json_conceal") || g:vim_json_conceal==1)
35 syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained 35 syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
36 else 36 else
37 syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=jsonEscape contained 37 syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=jsonEscape contained
38 endif 38 endif
39 39