completers can now raise StopIteration to prevent considering remaining completers

This commit is contained in:
adam j hartz 2016-06-07 23:41:31 -04:00
parent 7cc777a066
commit aae9f2b260

View file

@ -38,7 +38,10 @@ class Completer(object):
"""
ctx = ctx or {}
for func in builtins.__xonsh_completers__.values():
out = func(prefix, line, begidx, endidx, ctx)
try:
out = func(prefix, line, begidx, endidx, ctx)
except StopIteration:
return set(), len(prefix)
if isinstance(out, Sequence):
res, lprefix = out
else: