@@ -72,7 +72,7 @@ endfunction
7272
7373" configurable regexes that define continuation lines, not including (, {, or [.
7474if ! exists (' g:javascript_opfirst' )
75- let g: javascript_opfirst = ' \%([<>,?^%|*&]\|\/[^ /*]\|\([-.:+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)'
75+ let g: javascript_opfirst = ' \%([<>,?^%|*&]\|\/[/*]\@! \|\([-.:+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)'
7676endif
7777if ! exists (' g:javascript_continuation' )
7878 let g: javascript_continuation = ' \%([<=,.?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<in\%(stanceof\)\=\)'
@@ -94,9 +94,9 @@ function s:iscontOne(i,num,cont)
9494 let ind = indent (l: i ) + (! l: cont * s: W )
9595 let bL = 0
9696 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
9898 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
100100 return 0
101101 endif
102102 let bL += 1
@@ -155,8 +155,8 @@ endfunction
155155
156156function GetJavascriptIndent ()
157157 try
158- let save_magic = &magic
159- set magic
158+ let save_magic = &magic
159+ set magic
160160 if ! exists (' b:js_cache' )
161161 let b: js_cache = [0 ,0 ,0 ]
162162 endif
@@ -218,7 +218,7 @@ function GetJavascriptIndent()
218218 let b: js_cache = [v: lnum ,num,line (' .' ) == v: lnum ? b: js_cache [2 ] : col (' .' )]
219219
220220 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
222222 return indent (line (' .' ))
223223 endif
224224
0 commit comments