File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,25 +106,28 @@ function s:ParseCino(f)
106106 return sign * str2nr (n ) / max ([str2nr (divider),1 ])
107107endfunction
108108
109- " Optimized {skip} expr, used only once per GetJavascriptIndent() call
109+ " Optimized {skip} expr, only callable from the search loop which
110+ " GetJavascriptIndent does to find the containing [[{(] (relies on s:vars)
110111function s: SkipFunc ()
111112 if s: top_col == 1
112113 throw ' out of bounds'
113114 endif
114- let s: top_col = col ( ' . ' )
115- if getline ( ' . ' ) = ~ ' \%< ' . s: top_col . ' c\/.\{-}\/\|\%> ' . s: top_col . ' c[ '' "]\|\\$ '
115+ let s: top_col = 0
116+ if s: check_in
116117 if eval (s: skip_expr )
117- let s: top_col = 0
118+ return 1
118119 endif
119- return ! s: top_col
120- elseif s: check_in || search ( ' \m`\|\${\|\*\/ ' , ' nW ' . s: z , s: looksyn )
121- let s: check_in = eval (s: skip_expr )
122- if s: check_in
123- let s: top_col = 0
120+ let s: check_in = 0
121+ elseif getline ( ' . ' ) = ~ ' \%< ' . col ( ' . ' ). ' c\/.\{-}\/\|\%> ' . col ( ' . ' ). ' c[ '' "]\|\\$ '
122+ if eval (s: skip_expr )
123+ let s: looksyn = line ( ' . ' )
124+ return 1
124125 endif
126+ elseif search (' \m`\|\${\|\*\/' ,' nW' .s: z ,s: looksyn ) && eval (s: skip_expr )
127+ let s: check_in = 1
128+ return 1
125129 endif
126- let s: looksyn = line (' .' )
127- return s: check_in
130+ let [s: looksyn , s: top_col ] = getpos (' .' )[1 :2 ]
128131endfunction
129132
130133function s: AlternatePair ()
You can’t perform that action at this time.
0 commit comments