Skip to content

Commit 0c32d06

Browse files
committed
Fix escaping of 'Init signature:'
1 parent 8bea179 commit 0c32d06

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ftplugin/python/vim_ipython.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,9 @@ def get_doc_msg(msg_id):
360360
text = content['data']['text/plain']
361361
for line in text.split('\n'):
362362
b.append(strip_color_escapes(line).rstrip())
363-
if b[-1].startswith('Signature:'):
364-
b[-1] = re.sub(r'(\s+)(.*)$', r'\1`\2`', b[-1])
363+
if 'signature:' in b[-1].lower():
364+
left, _, right = b[-1].partition(': ')
365+
b[-1] = '{0}: `{1}`'.format(left, right)
365366
return b
366367
except KeyError: # no text/plain key
367368
return b

0 commit comments

Comments
 (0)