Skip to content

Commit 93c8f23

Browse files
committed
Fix s:ExprCol() sometimes go into infinity loop when calculating indent
1 parent 39e332a commit 93c8f23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

indent/javascript.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function s:ExprCol()
204204
return 1
205205
endif
206206
let bal = 0
207-
while s:SearchLoop('[{}?:]','bW',s:skip_expr)
207+
while s:SearchLoop('[{}?:]','bW',s:skip_expr) && bal >= -1
208208
if s:LookingAt() == ':'
209209
let bal -= !search('\m:\%#','bW')
210210
elseif s:LookingAt() == '?'

0 commit comments

Comments
 (0)