@@ -148,34 +148,24 @@ function s:GetMSL(lnum, in_one_line_scope)
148
148
" Otherwise, terminate search as we have found our MSL already.
149
149
let line = getline (lnum)
150
150
let col = match (line , s: msl_regex ) + 1
151
- let colprev = s: Match (msl, s: operator_first )
152
- if ((col > 0 && ! s: IsInStringOrComment (lnum, col )) || s: IsInString (lnum, strlen (line )) || colprev)
151
+ if (col > 0 && ! s: IsInStringOrComment (lnum, col )) || s: IsInString (lnum, strlen (line ))
153
152
let msl = lnum
154
- else
155
- " Don't use lines that are part of a one line scope as msl unless the
156
- " flag in_one_line_scope is set to 1
157
- "
158
- if a: in_one_line_scope
159
- break
160
- end
161
- let msl_one_line = s: Match (lnum, s: one_line_scope_regex )
162
- if msl_one_line == 0
163
- break
164
- endif
165
- endif
166
- let coli = matchend (line , ' ^\s*[]})]' )
167
- if coli
168
- let bs = strpart (' (){}[]' , stridx (' )}]' , line [coli - 1 ]) * 2 , 2 )
169
- let mnum = searchpair (escape (bs [0 ], ' \[' ), ' ' , bs [1 ], ' bW' , s: skip_expr ) > 0
170
- if mnum
171
- let lnum = mnum
172
- end
153
+ else
154
+ " Don't use lines that are part of a one line scope as msl unless the
155
+ " flag in_one_line_scope is set to 1
156
+ "
157
+ if a: in_one_line_scope
158
+ break
173
159
end
174
-
175
- let lnum = s: PrevNonBlankNonString (lnum - 1 )
176
- endwhile
177
- return msl
178
- endfunction
160
+ let msl_one_line = s: Match (lnum, s: one_line_scope_regex )
161
+ if msl_one_line == 0
162
+ break
163
+ endif
164
+ endif
165
+ let lnum = s: PrevNonBlankNonString (lnum - 1 )
166
+ endwhile
167
+ return msl
168
+ endfunction
179
169
180
170
function s: RemoveTrailingComments (content)
181
171
let single = ' \/\/\(.*\)\s*$'
@@ -411,13 +401,12 @@ function GetJavascriptIndent()
411
401
return indent (prevline) + s: sw ()
412
402
end
413
403
" If previous line starts with a operator...
414
- elseif (s: Match (prevline, s: operator_first ) || s: Match (v: lnum , ' ^\s*[)}]' ))
415
- let counts = s: LineHasOpeningBrackets (prevline)
416
- if counts[0 ] != ' 1' && counts[1 ] != ' 1' && counts[2 ] != ' 1'
417
- " dedent 1 level
404
+ elseif s: Match (prevline, s: operator_first ) && ! s: Match (prevline, s: comma_last )
405
+ let countscur = s: LineHasOpeningBrackets (v: lnum )
406
+ if countscur[0 ] != ' 2'
418
407
return indent (prevline) - s: sw ()
419
408
end
420
- endif
409
+ end
421
410
422
411
" If we are in a multi-line comment, cindent does the right thing.
423
412
if s: IsInMultilineComment (v: lnum , 1 ) && ! s: IsLineComment (v: lnum , 1 )
0 commit comments