diff --git a/indent/javascript.vim b/indent/javascript.vim index 07f4bc1f..4aeeb6da 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -205,14 +205,6 @@ function GetJavascriptIndent() let l:line = substitute(l:line,'^\s*\%(\/\*.\{-}\*\/\s*\)*','','') - if l:line =~# '^' . s:expr_case - let cpo_switch = &cpo - set cpo+=% - let ind = cindent(v:lnum) - let &cpo = cpo_switch - return ind - endif - " the containing paren, bracket, curly. Many hacks for performance call cursor(v:lnum,1) let idx = strlen(l:line) ? stridx('])}',l:line[0]) : -1 @@ -243,20 +235,27 @@ function GetJavascriptIndent() return indent(line('.')) endif + call call('cursor',b:js_cache[1:]) let s:W = s:sw() let pline = s:Trimline(l:lnum) - call call('cursor',b:js_cache[1:]) let bchar = getline('.')[col('.')-1] == '{' - let switch_offset = !num || !bchar || !(search(')\_s*\%#','bW') && - \ s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0 && search('\C\ 0 && search('\C\