Skip to content

Commit 30dcd71

Browse files
authored
nonstandard multichar ops (#1054)
refactor
1 parent 9802bca commit 30dcd71

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

indent/javascript.vim

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,22 +184,26 @@ endfunction
184184

185185
function s:ExprCol()
186186
let bal = 0
187-
while s:SearchLoop('[{}?]\|\_[^:]\zs::\@!','bW',s:skip_expr)
187+
while s:SearchLoop('[{}?:]','bW',s:skip_expr)
188188
if s:LookingAt() == ':'
189+
if getline('.')[col('.')-2] == ':'
190+
call cursor(0,col('.')-1)
191+
continue
192+
endif
189193
let bal -= 1
190194
elseif s:LookingAt() == '?'
191-
let bal += 1
192-
if bal == 1
193-
break
195+
if getline('.')[col('.'):col('.')+1] =~ '^\.\d\@!'
196+
continue
197+
elseif !bal
198+
return 1
194199
endif
200+
let bal += 1
195201
elseif s:LookingAt() == '{'
196-
let bal = !s:IsBlock()
197-
break
202+
return !s:IsBlock()
198203
elseif !s:GetPair('{','}','bW',s:skip_expr)
199204
break
200205
endif
201206
endwhile
202-
return s:Nat(bal)
203207
endfunction
204208

205209
" configurable regexes that define continuation lines, not including (, {, or [.

0 commit comments

Comments
 (0)