@@ -75,7 +75,7 @@ if !exists('g:javascript_continuation')
75
75
endif
76
76
77
77
let g: javascript_opfirst = ' ^' . g: javascript_opfirst
78
- let g: javascript_continuation .= s: line_term
78
+ let g: javascript_continuation .= ' $ '
79
79
80
80
function s: OneScope (lnum,text)
81
81
return cursor (a: lnum , match (' ' . a: text , ' \%(\<else\|\<do\|=>\)' . s: line_term )) > -1 ||
@@ -215,15 +215,15 @@ function GetJavascriptIndent()
215
215
endif
216
216
217
217
let s: W = s: sw ()
218
- let pline = substitute (substitute (getline (l: lnum ),s: expr_case , ' \=repeat(" ",strlen(submatch(0))) ' , ' ' ), ' :\@<!\/\/.*' , ' ' ,' ' )
218
+ let pline = substitute (substitute (getline (l: lnum ),' :\@<!\/\/.*' , ' ' , ' ' ), s: line_term , ' ' ,' ' )
219
219
call cursor (b: js_cache [1 ],b: js_cache [2 ])
220
220
let switch_offset = ! num || ! (search (' )\_s*\%#' ,' bW' ) &&
221
221
\ s: GetPair (' (' , ' )' , ' bW' , s: skip_expr , 100 ) > 0 && search (' \C\<switch\_s*\%#' ,' bW' )) ? 0 :
222
222
\ &cino !~ ' :' || ! has (' float' ) ? s: W :
223
223
\ float2nr (str2float (matchstr (&cino ,' .*:\zs[-0-9.]*' )) * (&cino = ~# ' .*:[^,]*s' ? s: W : 1 ))
224
224
225
225
" most significant, find the indent amount
226
- let isOp = l: line = ~# g: javascript_opfirst || pline = ~# g: javascript_continuation
226
+ let isOp = l: line = ~# g: javascript_opfirst || pline !~# s: expr_case . ' $ ' && pline = ~# g: javascript_continuation
227
227
let bL = s: iscontOne (l: lnum ,num,isOp)
228
228
let bL -= (bL && l: line = ~ ' ^{' ) * s: W
229
229
if isOp && (! num || cursor (b: js_cache [1 ],b: js_cache [2 ]) || s: IsBlock ())
0 commit comments