From e7df0983396b43fdaa356a2231d2690993808fad Mon Sep 17 00:00:00 2001 From: bounceme Date: Fri, 17 Jun 2016 22:53:41 -0700 Subject: [PATCH] let a continuation be determined with block close seems to fix #491, may be necessary to look for a more complex solution if this causes regressions --- indent/javascript.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indent/javascript.vim b/indent/javascript.vim index 4b8b1f94..4d54c399 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -140,7 +140,7 @@ function s:GetMSL(lnum, in_one_line_scope) " Start on the line we're at and use its indent. let msl = a:lnum let lnum = s:PrevNonBlankNonString(a:lnum - 1) - while lnum > 0 + while lnum > 0 && !s:Match(msl,s:line_pre . '[])}]') " If we have a continuation line, or we're in a string, use line as MSL. " Otherwise, terminate search as we have found our MSL already. let line = getline(lnum) @@ -360,8 +360,8 @@ function GetJavascriptIndent() continue end if parlnum > 0 - let ind = s:InMultiVarStatement(parlnum, 0, 0)|| s:LineHasOpeningBrackets(parlnum) !~ '2' - \ ? indent(parlnum) : indent(s:GetMSL(parlnum, 0)) + let ind = s:InMultiVarStatement(parlnum, 0, 0)|| s:LineHasOpeningBrackets(parlnum) !~ '2' ? + \ indent(parlnum) : indent(s:GetMSL(parlnum, 0)) endif endwhile return ind