File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,11 +251,19 @@ function GetJavascriptIndent()
251251 " 3.3. Work on the previous line. {{{2
252252 " -------------------------------
253253
254+ " If the line is empty and the previous nonblank line was a multi-line
255+ " comment, use that comment's indent. Deduct one char to account for the
256+ " space in ' */'.
257+ let nonblank_lnum = prevnonblank (v: lnum - 1 )
258+ if line = ~ ' ^\s*$' && s: IsInMultilineComment (nonblank_lnum, 1 )
259+ return indent (nonblank_lnum) - 1
260+ endif
261+
254262 " Find a non-blank, non-multi-line string line above the current line.
255263 let lnum = s: PrevNonBlankNonString (v: lnum - 1 )
256264
257265 " If the line is empty and inside a string, use the previous line.
258- if line = ~ ' ^\s*$' && lnum != prevnonblank ( v: lnum - 1 )
266+ if line = ~ ' ^\s*$' && lnum != nonblank_lnum
259267 return indent (prevnonblank (v: lnum ))
260268 endif
261269
You can’t perform that action at this time.
0 commit comments