6d38cad14c
I encountered an issue with Deoplete where Ultisnips suggestiosn wouldn't appear if there was a match in the current buffer with the same name as a Ultisnip snippet. This change allows the snippet and buffer match to appear side-by-side, which is less confusing. More information can be found on the issue on the Deoplete repo here: https://github.com/Shougo/deoplete.nvim/issues/138#issuecomment-174050309
22 lines
575 B
Python
22 lines
575 B
Python
from .base import Base
|
|
|
|
class Source(Base):
|
|
def __init__(self, vim):
|
|
Base.__init__(self, vim)
|
|
|
|
self.name = 'ultisnips'
|
|
self.mark = '[US]'
|
|
self.rank = 8
|
|
|
|
def gather_candidates(self, context):
|
|
suggestions = []
|
|
snippets = self.vim.eval(
|
|
'UltiSnips#SnippetsInCurrentScope()')
|
|
for trigger in snippets:
|
|
suggestions.append({
|
|
'word': trigger,
|
|
'menu': self.mark + ' ' + snippets.get(trigger, ''),
|
|
'dup': 1
|
|
})
|
|
return suggestions
|