Skip to content

Commit b3edf7f

Browse files
authored
cleaner cursor call
1 parent c746dbc commit b3edf7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

indent/javascript.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function GetJavascriptIndent()
245245

246246
let s:W = s:sw()
247247
let pline = s:Trimline(l:lnum)
248-
call cursor(b:js_cache[1],b:js_cache[2])
248+
call call('cursor',b:js_cache[1:])
249249
let bchar = getline('.')[col('.')-1] == '{'
250250
let switch_offset = !num || !bchar || !(search(')\_s*\%#','bW') &&
251251
\ s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0 && search('\C\<switch\_s*\%#','bW')) ? 0 :
@@ -256,7 +256,7 @@ function GetJavascriptIndent()
256256
let isOp = l:line =~# s:opfirst || pline !~# s:expr_case . '$' && pline =~# s:continuation
257257
let bL = s:iscontOne(l:lnum,num,isOp)
258258
let bL -= (bL && l:line[0] == '{') * s:W
259-
if isOp && (!num || bchar && cursor(b:js_cache[1],b:js_cache[2])+1 && s:IsBlock())
259+
if isOp && (!num || bchar && call('cursor',b:js_cache[1:])+1 && s:IsBlock())
260260
return (num ? indent(num) : -s:W) + (s:W * 2) + switch_offset + bL
261261
elseif num
262262
return indent(num) + s:W + switch_offset + bL

0 commit comments

Comments
 (0)