@@ -72,7 +72,7 @@ endfunction
72
72
73
73
" configurable regexes that define continuation lines, not including (, {, or [.
74
74
if ! exists (' g:javascript_opfirst' )
75
- let g: javascript_opfirst = ' \%([<>,?^%|*&]\|\/[^ /*]\|\([-.:+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)'
75
+ let g: javascript_opfirst = ' \%([<>,?^%|*&]\|\/[/*]\@! \|\([-.:+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)'
76
76
endif
77
77
if ! exists (' g:javascript_continuation' )
78
78
let g: javascript_continuation = ' \%([<=,.?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<in\%(stanceof\)\=\)'
@@ -94,9 +94,9 @@ function s:iscontOne(i,num,cont)
94
94
let ind = indent (l: i ) + (! l: cont * s: W )
95
95
let bL = 0
96
96
while l: i >= l: num && (! l: cont || ind > pind + s: W )
97
- if indent (l: i ) < ind " first line always true for !cont, false for !!cont
97
+ if indent (l: i ) < ind " first line always true for !a: cont, false for !!a: cont
98
98
if s: OneScope (l: i ,s: Trimline (l: i ))
99
- if expand (' <cword>' ) == # ' while' && s: GetPair (s: line_pre . ' \C\<do\>' ,' \C\<while\>' ,' bW' ,s: skip_expr ,100 ,l: num ) > 0
99
+ if expand (' <cword>' ) == # ' while' && s: GetPair (s: line_pre . ' \C\<do\>' ,' \C\<while\>' ,' bW' ,s: skip_expr ,100 ,l: num + ! ! a: num ) > 0
100
100
return 0
101
101
endif
102
102
let bL += 1
@@ -155,8 +155,8 @@ endfunction
155
155
156
156
function GetJavascriptIndent ()
157
157
try
158
- let save_magic = &magic
159
- set magic
158
+ let save_magic = &magic
159
+ set magic
160
160
if ! exists (' b:js_cache' )
161
161
let b: js_cache = [0 ,0 ,0 ]
162
162
endif
@@ -218,7 +218,7 @@ function GetJavascriptIndent()
218
218
let b: js_cache = [v: lnum ,num,line (' .' ) == v: lnum ? b: js_cache [2 ] : col (' .' )]
219
219
220
220
call cursor (v: lnum ,1 )
221
- if l: line = ~# ' ^while\>' && s: GetPair (s: line_pre . ' \C\<do\>' ,' \C\<while\>' ,' bW' ,s: skip_expr ,100 ,num) > 0
221
+ if l: line = ~# ' ^while\>' && s: GetPair (s: line_pre . ' \C\<do\>' ,' \C\<while\>' ,' bW' ,s: skip_expr ,100 ,num + 1 ) > 0
222
222
return indent (line (' .' ))
223
223
endif
224
224
0 commit comments