be more selective about when to use python completions

This commit is contained in:
adam j hartz 2016-06-03 12:58:09 -04:00
parent f5dee4fc5c
commit 1500a77702

View file

@ -26,6 +26,9 @@ def complete_python(prefix, line, start, end, ctx):
Completes based on the contents of the current Python environment,
the Python built-ins, and xonsh operators.
"""
first = line.split()[0]
if first in builtins.__xonsh_commands_cache__ and first not in ctx:
return None
filt = get_filter_function()
rtn = {s for s in XONSH_TOKENS if filt(s, prefix)}
if ctx is not None: