More completer example clarification

This commit is contained in:
con-f-use 2019-08-18 17:30:45 +02:00 committed by GitHub
parent 4b26928973
commit fef6743f4b
Failed to generate hash of commit

View file

@ -92,10 +92,10 @@ xonsh actually uses, in the ``xonsh.completers`` module.
def unbeliever_completer(prefix, line, begidx, endidx, ctx):
'''
Replaces "lou carcolh" with "snail" if tab is pressed after typing
"lou" and when typing "carcolh"
Replaces "lou carcolh" with "snail" if tab is pressed after at least
typing the "lou " part.
'''
if 'carcolh'.startswith(prefix) or 'lou' in line[:begidx].split()[-1:]:
if 'carcolh'.startswith(prefix) and 'lou' in line[:begidx].split()[-1:]:
return ({'snail'}, len('lou ') + len(prefix))