File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,14 +186,14 @@ function GetJavascriptIndent()
186186 \ float2nr (str2float (matchstr (&cino ,' .*:\zs[-0-9.]*' )) * (&cino = ~# ' .*:[^,]*s' ? s: sw () : 1 ))
187187
188188 " most significant, find the indent amount
189- if ( l: line = ~# g: javascript_opfirst || pline = ~# g: javascript_continuation) &&
190- \ (num == 0 || cursor (b: js_cache [1 ],b: js_cache [2 ]) || s: IsBlock ()) ||
189+ let isOp = l: line = ~# g: javascript_opfirst || pline = ~# g: javascript_continuation
190+ if isOp && (num == 0 || cursor (b: js_cache [1 ],b: js_cache [2 ]) || s: IsBlock ()) ||
191191 \ s: OneScope (l: lnum ,pline,0 ) = ~# ' \<\%(for\|each\|if\|let\|no\sb\|w\%(hile\|ith\)\)\>' &&
192192 \ l: line !~ s: line_pre . ' {'
193193 return (num > 0 ? indent (num) : - s: sw ()) + (s: sw () * 2 ) + switch_offset
194194 elseif num > 0
195195 let b: js_cache [3 ] = indent (num) + s: sw () + switch_offset
196- return b: js_cache [3 ] + known
196+ return b: js_cache [3 ] + (isOp ? known : 0 )
197197 endif
198198
199199endfunction
You can’t perform that action at this time.
0 commit comments