Skip to content

Commit 953abc2

Browse files
committed
Rename metadata fields to match Vim naming
1 parent 655a7dc commit 953abc2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ftplugin/python/ipy.vim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,16 @@ def process_matches(matches, metadata, result):
269269
for c, m in zip(completions, metadata):
270270
# vim can't handle null bytes in Python strings
271271
m = {k: v.replace('\0', '^@') for k, v in m.items()}
272-
result.c, result.m = c, m
272+
result.word = c
273273
if 'info' in m:
274-
r.text, r.info = m['text'], m['info']
275-
vim.command('call add(res, {"word": IPythonPyeval("r.c"), '
276-
'"menu": IPythonPyeval("r.text"), '
274+
result.menu, result.info = m['menu'], m['info']
275+
vim.command('call add(res, {"word": IPythonPyeval("r.word"), '
276+
'"menu": IPythonPyeval("r.menu"), '
277277
'"info": IPythonPyeval("r.info")})')
278278
else:
279-
r.text = m.get('text', '')
280-
vim.command('call add(res, {"word": IPythonPyeval("r.c"), '
281-
'"menu": IPythonPyeval("r.text")})')
279+
result.menu = m.get('menu', '')
280+
vim.command('call add(res, {"word": IPythonPyeval("r.word"), '
281+
'"menu": IPythonPyeval("r.menu")})')
282282
endpython
283283

284284
fun! CompleteIPython(findstart, base)

ftplugin/python/vim_ipython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def get_completion_metadata():
474474
else:
475475
metadata = content['user_expressions']['_completions']
476476
metadata = ast.literal_eval(metadata['data']['text/plain'])
477-
matches = [c['match'] for c in metadata]
477+
matches = [c['word'] for c in metadata]
478478
return matches, metadata
479479

480480
def vim_ipython_is_open():

0 commit comments

Comments
 (0)