File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -302,13 +302,19 @@ fun! CompleteIPython(findstart, base)
302302 return s: start
303303 endif
304304 let s: start = strchars (getline (' .' )[: col (' .' )-1 ]) - 1
305+ let bracket_level = 0
305306 while s: start > 0 && (line [s: start- 1 ] = ~ s: split_pattern
306307 \ || (g: ipython_greedy_matching && line [s: start- 1 ] == ' .'
307308 \ && s: start >= 2 && line [s: start- 2 ] = ~ ' \k' )
308309 \ || join (line [s: start- 2 :s: start- 1 ], ' ' ) == # ' ].' )
309- if g: ipython_greedy_matching && line [s: start- 1 ] == ' [' &&
310- \ (s: start == 1 || line [s: start- 2 ] !~ ' \k\|\]' )
311- break
310+ if g: ipython_greedy_matching && line [s: start- 1 ] == ' ['
311+ if (s: start == 1 || line [s: start- 2 ] !~ ' \k\|\]' )
312+ \ || bracket_level > 0
313+ break
314+ endif
315+ let bracket_level += 1
316+ elseif g: ipython_greedy_matching && line [s: start- 1 ] == ' ]'
317+ let bracket_level -= 1
312318 endif
313319 let s: start -= 1
314320 endwhile
You can’t perform that action at this time.
0 commit comments