Skip to content

Commit d7a5869

Browse files
committed
Merge pull request #399 from pangloss/bounceme-patch-1
other arrow syntaxes
2 parents af08aae + a51d0f3 commit d7a5869

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

indent/javascript.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function s:GetMSL(lnum, in_one_line_scope)
159159
let msl = lnum
160160

161161
" if there are more closing brackets, continue from the line which has the matching opening bracket
162-
elseif col2 > 0 && !s:IsInStringOrComment(msl, col2) && s:LineHasOpeningBrackets(msl)[0] == '2'
162+
elseif col2 > 0 && !s:IsInStringOrComment(msl, col2) && s:LineHasOpeningBrackets(msl)[0] == '2' && !a:in_one_line_scope
163163
call cursor(msl, 1)
164164
if searchpair('(', '', ')', 'bW', s:skip_expr) > 0
165165
let lnum = line('.')
@@ -490,12 +490,12 @@ function GetJavascriptIndent()
490490
if line =~ '[[({]'
491491
let counts = s:LineHasOpeningBrackets(lnum)
492492
if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
493-
if col('.') + 1 == col('$')
493+
if col('.') + 1 == col('$') || line =~ s:one_line_scope_regex
494494
return ind + s:sw()
495495
else
496496
return virtcol('.')
497497
endif
498-
elseif counts[1] == '1' || counts[2] == '1'
498+
elseif counts[1] == '1' || counts[2] == '1' && counts[0] != '2'
499499
return ind + s:sw()
500500
else
501501
call cursor(v:lnum, vcol)

0 commit comments

Comments
 (0)