Skip to content

Commit 672c379

Browse files
authored
Update javascript.vim
1 parent 2676ca0 commit 672c379

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

indent/javascript.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let b:did_indent = 1
1212

1313
" Now, set up our indentation expression and keys that trigger it.
1414
setlocal indentexpr=GetJavascriptIndent()
15-
setlocal nolisp noautoindent nosmartindent
15+
setlocal nolisp autoindent nosmartindent
1616
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e
1717
setlocal cinoptions+=j1,J1
1818

@@ -236,7 +236,6 @@ function GetJavascriptIndent()
236236
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : [line('.'),col('.')])
237237
let num = b:js_cache[1]
238238

239-
call call('cursor',b:js_cache[1:])
240239
let [s:W, pline, isOp, stmt, bL, switch_offset] = [s:sw(), s:Trim(l:lnum),0,0,0,0]
241240
if num
242241
if getline('.')[col('.')-1] == '{'
@@ -268,7 +267,7 @@ function GetJavascriptIndent()
268267
let bL -= (bL && l:line[0] == '{') * s:W
269268
endif
270269

271-
" most significant, find the indent amount
270+
" main return
272271
if isOp
273272
return (num ? indent(num) : -s:W) + (s:W * 2) + switch_offset + bL
274273
elseif num

0 commit comments

Comments
 (0)