Skip to content

Commit 63d6b72

Browse files
committed
Merge pull request #26 from nonameentername/master
Fix completion for import statements Prior to this patch, trying to complete on "import numpy." did not return any results. With this patch, that is now fixed.
2 parents 17cdd38 + 064ceae commit 63d6b72

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
@@ -517,14 +518,17 @@ fun! CompleteIPython(findstart, base)
517518
let start -= 1
518519
endwhile
519520
echo start
521+
python << endpython
522+
current_line = vim.current.line
523+
endpython
520524
return start
521525
else
522526
" find months matching with "a:base"
523527
let res = []
524528
python << endpython
525529
base = vim.eval("a:base")
526530
findstart = vim.eval("a:findstart")
527-
msg_id = km.shell_channel.complete(base, vim.current.line, vim.eval("col('.')"))
531+
msg_id = km.shell_channel.complete(base, current_line, vim.eval("col('.')"))
528532
try:
529533
m = get_child_msg(msg_id)
530534
matches = m['content']['matches']

0 commit comments

Comments
 (0)