Skip to content

Commit afecff2

Browse files
authored
v:lnum cleaning
1 parent 3cc3ef7 commit afecff2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

indent/javascript.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,8 @@ function GetJavascriptIndent()
204204
if !l:lnum
205205
return
206206
endif
207-
call cursor(v:lnum,1)
208207

209-
let l:line = l:line[indent('.'):]
208+
let l:line = substitute(l:line,'^\s*','','')
210209
if l:line[:1] == '/*'
211210
let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
212211
endif
@@ -215,6 +214,7 @@ function GetJavascriptIndent()
215214
endif
216215

217216
" the containing paren, bracket, or curly. Many hacks for performance
217+
call cursor(v:lnum,1)
218218
let idx = strlen(l:line) ? stridx('])}',l:line[0]) : -1
219219
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
220220
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))

0 commit comments

Comments
 (0)