File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 3838endif
3939
4040let s: line_pre = ' ^\s*\%(\%(\%(\/\*.\{-}\)\=\*\+\/\s*\)\=\)\@>'
41- let s: expr_case = s: line_pre . ' \%(\%(case\>.\+\)\|default\)\s*:\C'
41+ let s: expr_case = ' \< \%(\%(case\>.\+\)\|default\)\s*:\C'
4242" Regex of syntax group names that are or delimit string or are comments.
4343let s: syng_strcom = ' \%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)'
4444
@@ -170,16 +170,16 @@ function GetJavascriptIndent()
170170 return 0
171171 endif
172172
173- if l: line = ~# s: expr_case
173+ let l: line = substitute (l: line ,s: line_pre ,' ' ,' ' )
174+
175+ if l: line = ~# ' ^' . s: expr_case
174176 let cpo_switch = &cpo
175177 set cpo += %
176178 let ind = cindent (v: lnum )
177179 let &cpo = cpo_switch
178180 return ind
179181 endif
180182
181- let l: line = substitute (l: line ,s: line_pre ,' ' ,' ' )
182-
183183 " the containing paren, bracket, curly. Memoize, last lineNr either has the
184184 " same scope or starts a new one, unless if it closed a scope.
185185 call cursor (v: lnum ,1 )
You can’t perform that action at this time.
0 commit comments