Skip to content

Commit e4452cf

Browse files
authored
remove identical
1 parent 371a71a commit e4452cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

indent/javascript.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,13 @@ function GetJavascriptIndent()
233233
" the containing paren, bracket, curly. Memoize, last lineNr either has the
234234
" same scope or starts a new one, unless if it closed a scope.
235235
call cursor(v:lnum,1)
236+
let fclose = l:line =~ '^[])}]'
236237
if indent(l:lnum)
237238
let [s:looksyn,s:free] = [v:lnum - 1,1]
238239
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
239240
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
240241
let num = b:js_cache[1]
241-
elseif l:line =~ '^[])}]'
242+
elseif fclose
242243
let id = stridx('])}',l:line[0])
243244
let num = s:GetPair(escape('[({'[id],'['), escape('])}'[id],']'),'bW','s:skip_func(s:looksyn)',2000)
244245
elseif indent(v:lnum) && syns =~? 'block'
@@ -251,7 +252,7 @@ function GetJavascriptIndent()
251252
endif
252253

253254
let num = max([num,0])
254-
if l:line =~ '^[])}]'
255+
if fclose
255256
return !!num * indent(num)
256257
endif
257258
let b:js_cache = [v:lnum,num,line('.') == v:lnum && num ? b:js_cache[2] : col('.')]

0 commit comments

Comments
 (0)