Skip to content

Commit c334109

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rplugin/python3/deoplete/sources/LanguageClientSource.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515

1616

1717
def simplify_snippet(snip: str) -> str:
18-
return re.sub(r'(?<!\\)\$\d+', '', snip)
19-
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)
2021

2122
def convert_to_deoplete_candidate(item: Dict) -> Dict:
2223
word = None

0 commit comments

Comments
 (0)