File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,8 @@ fun! CompleteIPython(findstart, base)
306306 while s: start > 0 && (line [s: start- 1 ] = ~ s: split_pattern
307307 \ || (g: ipython_greedy_matching && line [s: start- 1 ] == ' .'
308308 \ && s: start >= 2 && line [s: start- 2 ] = ~ ' \k' )
309+ \ || (g: ipython_greedy_matching && line [s: start- 1 ] == ' -'
310+ \ && s: start >= 2 && line [s: start- 2 ] == ' [' )
309311 \ || join (line [s: start- 2 :s: start- 1 ], ' ' ) == # ' ].' )
310312 if g: ipython_greedy_matching && line [s: start- 1 ] == ' ['
311313 if (s: start == 1 || line [s: start- 2 ] !~ ' \k\|\]' )
@@ -325,6 +327,10 @@ fun! CompleteIPython(findstart, base)
325327 " find months matching with "a:base"
326328 let res = []
327329 if s: start == -1 | return [] | endif
330+ " don't complete numeric literals
331+ if a: base = ~? ' \v^[-+]?\d*\.?\d+(e[-+]?\d+)?\.$' | return [] | endif
332+ " don't complete incomplete string literals
333+ if a: base = ~? ' \v^(([^'' ].*)?['' ]|([^"].*)?["])\.$' | return [] | endif
328334 let start = s: start
329335 Python2or3 << endpython
330336base = vim .eval (" a:base" )
You can’t perform that action at this time.
0 commit comments