Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 64a435c

Browse files
committed
BUG: Non-end of line completions in IPython 3.x
Fixed issue where completions that occur not at the end of line where incorrectly completing at the end of the line.
1 parent 015aae9 commit 64a435c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ftplugin/python/vim_ipython.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ def get_doc_buffer(level=0):
310310
vim.command('setlocal syntax=python')
311311

312312
def ipy_complete(base, current_line, pos):
313-
msg_id = kc.shell_channel.complete(base, current_line, len(current_line))
313+
# pos is the location of the start of base, add the length
314+
# to get the completion position
315+
msg_id = kc.shell_channel.complete(base, current_line,
316+
int(pos) + len(base) - 1)
314317
try:
315318
m = get_child_msg(msg_id)
316319
matches = m['content']['matches']

0 commit comments

Comments
 (0)