Skip to content

Commit ee99079

Browse files
authored
fix chaining arrows scope (#1087)
1 parent 0922d26 commit ee99079

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

indent/javascript.vim

+6-1
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,13 @@ function s:OneScope()
267267
\ s:Pure('s:PreviousToken') != '.' && !(tok == 'while' && s:DoWhile())
268268
elseif s:Token() =~# '^else$\|^do$'
269269
return s:Pure('s:PreviousToken') != '.'
270+
elseif strpart(getline('.'),col('.')-2,2) == '=>'
271+
call cursor(0,col('.')-1)
272+
if s:PreviousToken() == ')'
273+
return s:GetPair('(', ')', 'bW', s:skip_expr)
274+
endif
275+
return 1
270276
endif
271-
return strpart(getline('.'),col('.')-2,2) == '=>'
272277
endfunction
273278

274279
function s:DoWhile()

0 commit comments

Comments
 (0)