Fix deoplete source

This commit is contained in:
Shougo Matsushita 2017-06-11 15:17:11 +09:00
parent 9996520d6b
commit 6f87e27d4e
1 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,9 @@ class Source(Base):
candidate['menu'] = candidate['menu_abbr']
def gather_candidates(self, context):
candidates = self.__cache.get(context['filetype'], [])
if context['filetype'] not in self.__cache:
self.on_event(context)
return self.__cache.get(context['filetype'], [])
if not re.match(r'\w\+$', context['complete_str']):
candidates = [x for x in candidates if x['options']['word']]
return candidates