Skip to content

Commit 088b268

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

indent/javascript.vim

Lines changed: 1 addition & 1 deletion
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 >= 0
208208
if s:LookingAt() == ':'
209209
let bal -= !search('\m:\%#','bW')
210210
elseif s:LookingAt() == '?'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy