Skip to content

Commit 9b2a032

Browse files
authored
fix list size error with setpos()
1 parent 7684f3c commit 9b2a032

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

indent/javascript.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Language: Javascript
33
" Maintainer: Chris Paul ( https://github.com/bounceme )
44
" URL: https://github.com/pangloss/vim-javascript
5-
" Last Change: June 27, 2017
5+
" Last Change: July 2, 2017
66

77
" Only load this indent file when no other was loaded.
88
if exists('b:did_indent')
@@ -317,7 +317,7 @@ endfunction
317317

318318
function s:DoWhile()
319319
if expand('<cword>') ==# 'while'
320-
let l:pos = searchpos('\m\<','cbW')
320+
let cpos = searchpos('\m\<','cbW')
321321
while search('\m\C[{}]\|\<\%(do\|while\)\>','bW')
322322
if !eval(s:skip_expr)
323323
if (s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr,200) ?
@@ -327,7 +327,7 @@ function s:DoWhile()
327327
break
328328
endif
329329
endwhile
330-
call setpos('.',l:pos)
330+
call call('cursor',cpos)
331331
endif
332332
endfunction
333333

0 commit comments

Comments
 (0)