Skip to content

Commit b3ebfa5

Browse files
committed
c style opening curly braces (#426)
* c style opening curly braces #68 * Update javascript.vim
1 parent aa9a46a commit b3ebfa5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

indent/javascript.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ function GetJavascriptIndent()
345345
if s:IsInMultilineComment(v:lnum, 1) && !s:IsLineComment(v:lnum, 1)
346346
return cindent(v:lnum)
347347
endif
348+
349+
" single opening bracket will assume you want a c style of indenting
350+
if s:Match(v:lnum, '^\s*{' . s:line_term) && s:GetMSL(v:lnum,0) == v:lnum
351+
return cindent(v:lnum)
352+
endif
348353

349354
" cindent each line which has a switch label
350355
if (line =~ s:expr_case)

0 commit comments

Comments
 (0)