From e7d6da1b562c0b8aae37b0e6104e22edd3fc5174 Mon Sep 17 00:00:00 2001 From: Arne Goeteyn Date: Tue, 21 Aug 2018 22:45:56 +0200 Subject: [PATCH] fix indexerror when candidate is bad --- rplugin/python3/deoplete/sources/rust.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rplugin/python3/deoplete/sources/rust.py b/rplugin/python3/deoplete/sources/rust.py index 5664f3d..1bfd8a4 100644 --- a/rplugin/python3/deoplete/sources/rust.py +++ b/rplugin/python3/deoplete/sources/rust.py @@ -56,14 +56,15 @@ def gather_candidates(self, ctx): for match in matches: tokens = match.split(",") - candidate = { - 'word': tokens[0], - 'kind': tokens[4], - 'menu': tokens[5], - 'info': ','.join(tokens[5:]), - 'dup': self.__dup, - } - candidates.append(candidate) + if len(tokens) > 5: + candidate = { + 'word': tokens[0], + 'kind': tokens[4], + 'menu': tokens[5], + 'info': ','.join(tokens[5:]), + 'dup': self.__dup, + } + candidates.append(candidate) return candidates