File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,12 +61,12 @@ let s:line_term = '\s*\%(\/\*.*\*\/\s*\)*\%(:\@<!\/\/.*\)\=$'
6161
6262" configurable regexes that define continuation lines, not including (, {, or [.
6363if ! exists (' g:javascript_opfirst' )
64- let g: javascript_opfirst = ' \%([,:?^%]\|\([-/.+]\)\%(\1\|\*\|\/\)\@!\|\*\/\@!\|=>\@!\||\|&\|in\%(stanceof\)\=\>\)\C'
64+ let g: javascript_opfirst = ' \%([<> ,:?^%]\|\([-/.+]\)\%(\1\|\*\|\/\)\@!\|\*\/\@!\|=>\@!\||\|&\|in\%(stanceof\)\=\>\)\C'
6565endif
6666let g: javascript_opfirst = s: line_pre . g: javascript_opfirst
6767
6868if ! exists (' g:javascript_continuation' )
69- let g: javascript_continuation = ' \%([*,.?:^%]\|+\@<!+\|-\@<!-\|\*\@<!\/\|=\||\|&\|\<in\%(stanceof\)\=\)\C'
69+ let g: javascript_continuation = ' \%([< *,.?:^%]\|+\@<!+\|-\@<!-\|=\@<!> \|\*\@<!\/\|=\||\|&\|\<in\%(stanceof\)\=\)\C'
7070endif
7171let g: javascript_continuation .= s: line_term
7272
@@ -155,7 +155,8 @@ function GetJavascriptIndent()
155155 endif
156156 " }}}
157157
158- " the containing paren, bracket, curly
158+ " the containing paren, bracket, curly. Memoize, last lineNr either has the
159+ " same scope or starts a new one, unless if it closed a scope.
159160 let pcounts = [0 ]
160161 if b: js_cache [0 ] >= lnum && b: js_cache [0 ] <= v: lnum && b: js_cache [0 ] &&
161162 \ (b: js_cache [0 ] > lnum || map (pcounts,' s:LineHasOpeningBrackets(lnum)' )[0 ][0 ] !~ ' 2' )
You can’t perform that action at this time.
0 commit comments