on master help sign in
Improve VimL regex highlighting
29ea396Ensar Sarajčić
assets/syntaxes.bin

Binary file not shown.

assets/syntaxes/02_Extra/VimL.sublime-syntax+2−2
@@ -75,10 +75,10 @@ contexts:
75 - match: '''(''''|\n[^\S\n]*\\|[^\n''])*'''
75 - match: '''(''''|\n[^\S\n]*\\|[^\n''])*'''
76 scope: string.quoted.single.viml
76 scope: string.quoted.single.viml
77 string_regex:
77 string_regex:
78− - match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
78+ - match: '[gvs]{1}/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
79 scope: string.regexp.viml
79 scope: string.regexp.viml
80 support_function:
80 support_function:
81− - match: \b(set(local|global)?|let|command|filetype|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b
81+ - match: \b(set(local|global)?|let|command|filetype|syntax|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b
82 scope: support.function.viml
82 scope: support.function.viml
83 support_type:
83 support_type:
84 - match: <.*?>
84 - match: <.*?>
tests/syntax-tests/highlighted/VimL/source.vim+10−3
@@ -53,6 +53,7 @@
53
53
54command! -nargs=? Echo :call EchoFunc(<args>)
54command! -nargs=? Echo :call EchoFunc(<args>)
55
55
56+" TODO test stuff
56let g:global = "global var"
57let g:global = "global var"
57let s:script_var = "script var"
58let s:script_var = "script var"
58let w:window_var = "window war"
59let w:window_var = "window war"
@@ -67,19 +68,25 @@
67echo "Hello" == "Hello2"
68echo "Hello" == "Hello2"
68echo "Hello" is "Hello2"
69echo "Hello" is "Hello2"
69echo "Hello" isnot "Hello2"
70echo "Hello" isnot "Hello2"
70−echo "Hello" =~ "Hello2"
71+echo "Hello" =~ 'xx*'
71echo "Hello" !~ "Hello2"
72echo "Hello" !~ "Hello2"
72echo "Hello" !~ "Hello2"
73echo "Hello" !~ "Hello2"
73
74
74echo "/This/should/not/be/a/regex"
75echo "/This/should/not/be/a/regex"
75
76
76" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)
77" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)
77−set runtimepath=~/foo/bar
78+set runtimepath=~/foo/bar
79+
80+silent g/Aap/p
78
81
79let g:dict = {}
82let g:dict = {}
80let g:dict.item = ['l1', 'l2']
83let g:dict.item = ['l1', 'l2']
81
84
82let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
85let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
83
86
87+silent g/regex/
88+silent v/regex/
89+silent %s/regex/not_regex/
90+
84filetype plugin indent on
91filetype plugin indent on
85−syntax enable
92+syntax enable
tests/syntax-tests/source/VimL/source.vim+8−1
@@ -53,6 +53,7 @@ imap <C-h> <C-r>=HelloWorld("World")<CR>
53
53
54command! -nargs=? Echo :call EchoFunc(<args>)
54command! -nargs=? Echo :call EchoFunc(<args>)
55
55
56+" TODO test stuff
56let g:global = "global var"
57let g:global = "global var"
57let s:script_var = "script var"
58let s:script_var = "script var"
58let w:window_var = "window war"
59let w:window_var = "window war"
@@ -67,7 +68,7 @@ echo "Hello" ==? "Hello2"
67echo "Hello" == "Hello2"
68echo "Hello" == "Hello2"
68echo "Hello" is "Hello2"
69echo "Hello" is "Hello2"
69echo "Hello" isnot "Hello2"
70echo "Hello" isnot "Hello2"
70−echo "Hello" =~ "Hello2"
71+echo "Hello" =~ 'xx*'
71echo "Hello" !~ "Hello2"
72echo "Hello" !~ "Hello2"
72echo "Hello" !~ "Hello2"
73echo "Hello" !~ "Hello2"
73
74
@@ -76,10 +77,16 @@ echo "/This/should/not/be/a/regex"
76" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)
77" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)
77set runtimepath=~/foo/bar
78set runtimepath=~/foo/bar
78
79
80+silent g/Aap/p
81+
79let g:dict = {}
82let g:dict = {}
80let g:dict.item = ['l1', 'l2']
83let g:dict.item = ['l1', 'l2']
81
84
82let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
85let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
83
86
87+silent g/regex/
88+silent v/regex/
89+silent %s/regex/not_regex/
90+
84filetype plugin indent on
91filetype plugin indent on
85syntax enable
92syntax enable