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 38
38
endif
39
39
40
40
let 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'
42
42
" Regex of syntax group names that are or delimit string or are comments.
43
43
let s: syng_strcom = ' \%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)'
44
44
@@ -170,16 +170,16 @@ function GetJavascriptIndent()
170
170
return 0
171
171
endif
172
172
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
174
176
let cpo_switch = &cpo
175
177
set cpo += %
176
178
let ind = cindent (v: lnum )
177
179
let &cpo = cpo_switch
178
180
return ind
179
181
endif
180
182
181
- let l: line = substitute (l: line ,s: line_pre ,' ' ,' ' )
182
-
183
183
" the containing paren, bracket, curly. Memoize, last lineNr either has the
184
184
" same scope or starts a new one, unless if it closed a scope.
185
185
call cursor (v: lnum ,1 )
You can’t perform that action at this time.
0 commit comments