Skip to content

Commit

Permalink
Fix s:ExprCol() sometimes go into infinity loop when calculating indent
Browse files Browse the repository at this point in the history
  • Loading branch information
shirohana committed Jul 28, 2018
1 parent 39e332a commit 93c8f23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion indent/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function s:ExprCol()
return 1
endif
let bal = 0
while s:SearchLoop('[{}?:]','bW',s:skip_expr)
while s:SearchLoop('[{}?:]','bW',s:skip_expr) && bal >= -1
if s:LookingAt() == ':'
let bal -= !search('\m:\%#','bW')
elseif s:LookingAt() == '?'
Expand Down

0 comments on commit 93c8f23

Please sign in to comment.