Skip to content

Commit 617ccb5

Browse files
committed
Update javascript.vim
oh my
1 parent d2fa176 commit 617ccb5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

indent/javascript.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ let s:one_line_scope_regex = '\%(\%(\<else\>\|\<\%(if\|for\|while\)\>\s*(\%([^()
7070
" Regex that defines blocks.
7171
let 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

7575
let s:var_stmt = '^\s*\%(const\|let\|var\)'
7676

@@ -330,6 +330,7 @@ function GetJavascriptIndent()
330330
return cindent(v:lnum)
331331
endif
332332

333+
" cindent each line which has a switch label
333334
if (line =~ s:expr_case)
334335
return cindent(v:lnum)
335336
endif

0 commit comments

Comments
 (0)