Skip to content

Commit 0a2325a

Browse files
committed
Replace placeholders in completion text
In deoplete source, replace the placeholders with the neosnippet format.
1 parent 2760b3f commit 0a2325a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rplugin/python3/deoplete/sources/LanguageClientSource.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616

1717
def simplify_snippet(snip: str) -> str:
18-
return re.sub(r'(?<!\\)\$\d+', '', snip)
18+
snip = re.sub(r'(?<!\\)\$(?P<num>\d+)', '<`\g<num>`>', snip)
19+
return re.sub(r'(?<!\\)\${(?P<num>\d+):(?P<desc>.+?)}',
20+
'<`\g<num>:\g<desc>`>', snip)
1921

2022

2123
def convert_to_deoplete_candidate(item: Dict) -> Dict:

0 commit comments

Comments
 (0)