File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed 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*(\%([^()
70
70
" Regex that defines blocks.
71
71
let s: block_regex = ' \%([{([]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s: line_term
72
72
73
- let s: operator_first = ' ^\s*\%([*/ .:?]\|\([-+]\)\1\@!\|||\|&&\)'
73
+ let s: operator_first = ' ^\s*\%([*.:?]\|\([/ -+]\)\1\@!\|||\|&&\)'
74
74
75
75
let s: var_stmt = ' ^\s*\%(const\|let\|var\)'
76
76
@@ -325,6 +325,11 @@ function GetJavascriptIndent()
325
325
" previous nonblank line number
326
326
let prevline = prevnonblank (v: lnum - 1 )
327
327
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
+
328
333
if (line = ~ s: expr_case )
329
334
return cindent (v: lnum )
330
335
endif
@@ -423,11 +428,6 @@ function GetJavascriptIndent()
423
428
return indent (prevline) - s: sw ()
424
429
endif
425
430
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
-
431
431
" Check for multiple var assignments
432
432
" let var_indent = s:GetVarIndent(v:lnum)
433
433
" if var_indent >= 0
You can’t perform that action at this time.
0 commit comments