Skip to content

Commit 064ceae

Browse files
fix omnicomplete for import statements
1 parent 1a5ca84 commit 064ceae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ftplugin/python/ipy.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ reselect = False # reselect lines after sending from Visual mode
2525
show_execution_count = True # wait to get numbers for In[43]: feedback?
2626
monitor_subchannel = True # update vim-ipython 'shell' on every send?
2727
run_flags= "-i" # flags to for IPython's run magic when using <F5>
28+
current_line = ''
2829

2930
import vim
3031
import sys
@@ -485,14 +486,17 @@ fun! CompleteIPython(findstart, base)
485486
let start -= 1
486487
endwhile
487488
echo start
489+
python << endpython
490+
current_line = vim.current.line
491+
endpython
488492
return start
489493
else
490494
" find months matching with "a:base"
491495
let res = []
492496
python << endpython
493497
base = vim.eval("a:base")
494498
findstart = vim.eval("a:findstart")
495-
msg_id = km.shell_channel.complete(base, vim.current.line, vim.eval("col('.')"))
499+
msg_id = km.shell_channel.complete(base, current_line, vim.eval("col('.')"))
496500
try:
497501
m = get_child_msg(msg_id)
498502
matches = m['content']['matches']

0 commit comments

Comments
 (0)