File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ let s:one_line_scope_regex = '\%(\%(\<else\>\|\<\%(if\|for\|while\)\>\s*(\%([^()
7070" Regex that defines blocks.
7171let s: block_regex = ' \%([{([]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s: line_term
7272
73- let s: operator_first = ' ^\s*\%([*/ .:?]\|\([-+]\)\1\@!\|||\|&&\)'
73+ let s: operator_first = ' ^\s*\%([*.:?]\|\([/ -+]\)\1\@!\|||\|&&\)'
7474
7575let s: var_stmt = ' ^\s*\%(const\|let\|var\)'
7676
@@ -325,6 +325,11 @@ function GetJavascriptIndent()
325325 " previous nonblank line number
326326 let prevline = prevnonblank (v: lnum - 1 )
327327
328+ " If we are in a multi-line comment, cindent does the right thing.
329+ if s: IsInMultilineComment (v: lnum , 1 ) && ! s: IsLineComment (v: lnum , 1 )
330+ return cindent (v: lnum )
331+ endif
332+
328333 if (line = ~ s: expr_case )
329334 return cindent (v: lnum )
330335 endif
@@ -423,11 +428,6 @@ function GetJavascriptIndent()
423428 return indent (prevline) - s: sw ()
424429 endif
425430
426- " If we are in a multi-line comment, cindent does the right thing.
427- if s: IsInMultilineComment (v: lnum , 1 ) && ! s: IsLineComment (v: lnum , 1 )
428- return cindent (v: lnum )
429- endif
430-
431431 " Check for multiple var assignments
432432" let var_indent = s:GetVarIndent(v:lnum)
433433" if var_indent >= 0
You can’t perform that action at this time.
0 commit comments