Skip to content

Commit 3d60f0d

Browse files
committed
Update javascript.vim
1 parent 01021fe commit 3d60f0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

indent/javascript.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ function s:GetMSL(lnum, in_one_line_scope)
145145
" Otherwise, terminate search as we have found our MSL already.
146146
let line = getline(lnum)
147147
let col = match(line, s:msl_regex) + 1
148-
if (col > 0 && !s:IsInStringOrComment(lnum, col)) || s:IsInString(lnum, strlen(line))
148+
let colprev = s:Match(msl, s:operator_first)
149+
if ((col > 0 && !s:IsInStringOrComment(lnum, col)) || s:IsInString(lnum, strlen(line)) || colprev)
149150
let msl = lnum
150151
else
151152
" Don't use lines that are part of a one line scope as msl unless the
@@ -390,7 +391,7 @@ function GetJavascriptIndent()
390391
if mnum > 0 && s:Match(mnum, s:operator_first)
391392
return indent(mnum)
392393
end
393-
else
394+
elseif counts[0] != '1' && counts[1] != '1' && counts[2] != '1'
394395
" otherwise, indent 1 level
395396
return indent(prevline) + s:sw()
396397
end

0 commit comments

Comments
 (0)