on master help sign in
Improve VimL regex highlighting

**NOTES:** - PR is not yet merged in upstream repository (https://github.com/SalGnt/Sublime-VimL/pull/12), but sublime-syntax file is already updated with changes. - Updated syntax test files are added as well This fixes #1064

commit29ea396c311d9f1992c5e876752f2c50f05316c2 authorEnsar Sarajčić <es.ensar@gmail.com> dateSun 27 Dec 2020, 15:23 (6 years ago) parent171d215
4 files changed+20−6
assets/syntaxes.bin assets/syntaxes/02_Extra/VimL.sublime-syntax+2−2 tests/syntax-tests/highlighted/VimL/source.vim+10−3 tests/syntax-tests/source/VimL/source.vim+8−1
assets/syntaxes.bin

Binary file not shown.

assets/syntaxes/02_Extra/VimL.sublime-syntax+2−2
@@ -75,10 +75,10 @@ contexts:
7575 - match: '''(''''|\n[^\S\n]*\\|[^\n''])*'''
7676 scope: string.quoted.single.viml
7777 string_regex:
78− - match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
78+ - match: '[gvs]{1}/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
7979 scope: string.regexp.viml
8080 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
8282 scope: support.function.viml
8383 support_type:
8484 - match: <.*?>
tests/syntax-tests/highlighted/VimL/source.vim+10−3
@@ -53,6 +53,7 @@
5353
5454command! -nargs=? Echo :call EchoFunc(<args>)
5555
56+" TODO test stuff
5657let g:global = "global var"
5758let s:script_var = "script var"
5859let w:window_var = "window war"
@@ -67,19 +68,25 @@
6768echo "Hello" == "Hello2"
6869echo "Hello" is "Hello2"
6970echo "Hello" isnot "Hello2"
70−echo "Hello" =~ "Hello2"
71+echo "Hello" =~ 'xx*'
7172echo "Hello" !~ "Hello2"
7273echo "Hello" !~ "Hello2"
7374
7475echo "/This/should/not/be/a/regex"
7576
7677" 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
7881
7982let g:dict = {}
8083let g:dict.item = ['l1', 'l2']
8184
8285let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
8386
87+silent g/regex/
88+silent v/regex/
89+silent %s/regex/not_regex/
90+
8491filetype 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>
5353
5454command! -nargs=? Echo :call EchoFunc(<args>)
5555
56+" TODO test stuff
5657let g:global = "global var"
5758let s:script_var = "script var"
5859let w:window_var = "window war"
@@ -67,7 +68,7 @@ echo "Hello" ==? "Hello2"
6768echo "Hello" == "Hello2"
6869echo "Hello" is "Hello2"
6970echo "Hello" isnot "Hello2"
70−echo "Hello" =~ "Hello2"
71+echo "Hello" =~ 'xx*'
7172echo "Hello" !~ "Hello2"
7273echo "Hello" !~ "Hello2"
7374
@@ -76,10 +77,16 @@ echo "/This/should/not/be/a/regex"
7677" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)
7778set runtimepath=~/foo/bar
7879
80+silent g/Aap/p
81+
7982let g:dict = {}
8083let g:dict.item = ['l1', 'l2']
8184
8285let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
8386
87+silent g/regex/
88+silent v/regex/
89+silent %s/regex/not_regex/
90+
8491filetype plugin indent on
8592syntax enable