mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-18 20:11:03 +00:00
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
This commit is contained in:
parent
171d215f91
commit
29ea396c31
BIN
assets/syntaxes.bin
vendored
BIN
assets/syntaxes.bin
vendored
Binary file not shown.
4
assets/syntaxes/02_Extra/VimL.sublime-syntax
vendored
4
assets/syntaxes/02_Extra/VimL.sublime-syntax
vendored
@ -75,10 +75,10 @@ contexts:
|
||||
- match: '''(''''|\n[^\S\n]*\\|[^\n''])*'''
|
||||
scope: string.quoted.single.viml
|
||||
string_regex:
|
||||
- match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
|
||||
- match: '[gvs]{1}/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
|
||||
scope: string.regexp.viml
|
||||
support_function:
|
||||
- match: \b(set(local|global)?|let|command|filetype|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b
|
||||
- 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
|
||||
scope: support.function.viml
|
||||
support_type:
|
||||
- match: <.*?>
|
||||
|
@ -53,6 +53,7 @@
|
||||
|
||||
[38;2;102;217;239mcommand[0m[38;2;248;248;242m! [0m[3;38;2;166;226;46m-nargs=[0m[38;2;248;248;242m? Echo :call [0m[38;2;102;217;239mEchoFunc[0m[38;2;248;248;242m([0m[3;38;2;166;226;46m<args>[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;117;113;94m" TODO test stuff[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mg:global[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"global var"[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255ms:script_var[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"script var"[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mw:window_var[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"window war"[0m
|
||||
@ -67,19 +68,25 @@
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m is [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114misnot[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m=~[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m=~[0m[38;2;248;248;242m [0m[38;2;230;219;116m'xx*'[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m!~[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m!~[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"/This/should/not/be/a/regex"[0m
|
||||
|
||||
[38;2;117;113;94m" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)[0m
|
||||
[38;2;102;217;239mset[0m[38;2;248;248;242m runtimepath[0m[38;2;249;38;114m=~[0m[38;2;246;170;17m/foo/[0m[38;2;248;248;242mbar[0m
|
||||
[38;2;102;217;239mset[0m[38;2;248;248;242m runtimepath[0m[38;2;249;38;114m=~[0m[38;2;248;248;242m/foo/bar[0m
|
||||
|
||||
[38;2;248;248;242msilent [0m[38;2;246;170;17mg/Aap/[0m[38;2;248;248;242mp[0m
|
||||
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mg:dict[0m[38;2;248;248;242m = {}[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mg:dict[0m[38;2;249;38;114m.[0m[38;2;248;248;242mitem = [[0m[38;2;230;219;116m'l1'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'l2'[0m[38;2;248;248;242m][0m
|
||||
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mg:dict2[0m[38;2;248;248;242m = {[0m[38;2;230;219;116m'dict_item'[0m[38;2;248;248;242m: [[0m[38;2;230;219;116m'l1'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'l2'[0m[38;2;248;248;242m], [0m[38;2;230;219;116m'di2'[0m[38;2;248;248;242m: [0m[38;2;230;219;116m'x'[0m[38;2;248;248;242m}[0m
|
||||
|
||||
[38;2;248;248;242msilent [0m[38;2;246;170;17mg/regex/[0m
|
||||
[38;2;248;248;242msilent [0m[38;2;246;170;17mv/regex/[0m
|
||||
[38;2;248;248;242msilent [0m[38;2;249;38;114m%[0m[38;2;246;170;17ms/regex/[0m[38;2;248;248;242mnot_regex/[0m
|
||||
|
||||
[38;2;102;217;239mfiletype[0m[38;2;248;248;242m plugin indent on[0m
|
||||
[38;2;248;248;242msyntax enable[0m
|
||||
[38;2;102;217;239msyntax[0m[38;2;248;248;242m enable[0m
|
||||
|
@ -53,6 +53,7 @@ imap <C-h> <C-r>=HelloWorld("World")<CR>
|
||||
|
||||
command! -nargs=? Echo :call EchoFunc(<args>)
|
||||
|
||||
" TODO test stuff
|
||||
let g:global = "global var"
|
||||
let s:script_var = "script var"
|
||||
let w:window_var = "window war"
|
||||
@ -67,7 +68,7 @@ echo "Hello" ==? "Hello2"
|
||||
echo "Hello" == "Hello2"
|
||||
echo "Hello" is "Hello2"
|
||||
echo "Hello" isnot "Hello2"
|
||||
echo "Hello" =~ "Hello2"
|
||||
echo "Hello" =~ 'xx*'
|
||||
echo "Hello" !~ "Hello2"
|
||||
echo "Hello" !~ "Hello2"
|
||||
|
||||
@ -76,10 +77,16 @@ echo "/This/should/not/be/a/regex"
|
||||
" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)
|
||||
set runtimepath=~/foo/bar
|
||||
|
||||
silent g/Aap/p
|
||||
|
||||
let g:dict = {}
|
||||
let g:dict.item = ['l1', 'l2']
|
||||
|
||||
let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
|
||||
|
||||
silent g/regex/
|
||||
silent v/regex/
|
||||
silent %s/regex/not_regex/
|
||||
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
Loading…
x
Reference in New Issue
Block a user