Skip to content

Commit 8bea179

Browse files
committed
Escape funcsigs with backticks to not confuse rst
1 parent c624274 commit 8bea179

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ftplugin/python/vim_ipython.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ 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])
363365
return b
364366
except KeyError: # no text/plain key
365367
return b
@@ -369,7 +371,7 @@ def get_doc_msg(msg_id):
369371
c = content.get(field,None)
370372
if c:
371373
if field in ['definition']:
372-
c = strip_color_escapes(c).rstrip()
374+
c = '`%s`' % strip_color_escapes(c).rstrip()
373375
s = field.replace('_',' ').title()+':'
374376
s = s.ljust(n)
375377
if c.find('\n')==-1:

0 commit comments

Comments
 (0)