|
37 | 37 | endfunction
|
38 | 38 | endif
|
39 | 39 |
|
40 |
| -let s:case_stmt = '\<\%(\%(case\>\s*[^[:blank:]:].\{-}\)\|default\)\s*:\C' |
| 40 | +let s:case_stmt = '\<\%(case\>\s*[^[:blank:]:].\{-}\|default\s*\):\C' |
41 | 41 |
|
42 | 42 | " Regex of syntax group names that are or delimit string or are comments.
|
43 |
| -let s:syng_strcom = '\%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)' |
| 43 | +let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template' |
44 | 44 | " Expression used to check whether we should skip a match with searchpair().
|
45 | 45 | let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
|
46 | 46 | function s:skip_func(lnum)
|
47 |
| - if !s:free || search('`\|\%(\*\/\)','nW',a:lnum) |
| 47 | + if !s:free || search('`\|\*\/','nW',a:lnum) |
48 | 48 | let s:free = !eval(s:skip_expr . " . '\\|html'")
|
49 | 49 | let s:looksyn = s:free ? line('.') : s:looksyn
|
50 | 50 | return !s:free
|
@@ -79,7 +79,7 @@ endfunction
|
79 | 79 | function s:Trim(ln)
|
80 | 80 | let pline = substitute(getline(a:ln),'\s*$','','')
|
81 | 81 | let l:max = max([strridx(pline,'//'),strridx(pline,'/*'),0])
|
82 |
| - while l:max && synIDattr(synID(a:ln, strlen(pline), 0), 'name') =~? '\%(comment\|doc\)' |
| 82 | + while l:max && synIDattr(synID(a:ln, strlen(pline), 0), 'name') =~? 'comment\|doc' |
83 | 83 | let pline = substitute(strpart(pline, 0, l:max),'\s*$','','')
|
84 | 84 | let l:max = max([strridx(pline,'//'),strridx(pline,'/*'),0])
|
85 | 85 | endwhile
|
@@ -139,7 +139,7 @@ function s:IsBlock(...)
|
139 | 139 | let syn = char =~ '[{>/]' || l:ln != line('.') ? synIDattr(synID(line('.'),col('.')-(char == '{'),0),'name') : ''
|
140 | 140 | if char is ''
|
141 | 141 | return 1
|
142 |
| - elseif syn =~? '\%(xml\|jsx\)' |
| 142 | + elseif syn =~? 'xml\|jsx' |
143 | 143 | return char != '{'
|
144 | 144 | elseif syn =~? 'comment'
|
145 | 145 | return search('\/[/*]','bW') && s:IsBlock(l:ln)
|
@@ -194,13 +194,13 @@ function GetJavascriptIndent()
|
194 | 194 | let syns = synIDattr(synID(v:lnum, 1, 0), 'name')
|
195 | 195 |
|
196 | 196 | " start with strings,comments,etc.
|
197 |
| - if syns =~? '\%(comment\|doc\)' |
| 197 | + if syns =~? 'comment\|doc' |
198 | 198 | if l:line =~ '^\s*\*'
|
199 | 199 | return cindent(v:lnum)
|
200 | 200 | elseif l:line !~ '^\s*\/'
|
201 | 201 | return -1
|
202 | 202 | endif
|
203 |
| - elseif syns =~? '\%(string\|template\)' && l:line !~ '^[''"]' |
| 203 | + elseif syns =~? 'string\|template' && l:line !~ '^[''"]' |
204 | 204 | return -1
|
205 | 205 | endif
|
206 | 206 | let l:lnum = s:PrevCodeLine(v:lnum - 1)
|
|
0 commit comments