Commit a9c31268 authored by adam j hartz's avatar adam j hartz

another tab completion fix

parent 1e670a19
......@@ -16,4 +16,4 @@
# xonsh is Copyright (c) 2015-2016 the xonsh developers and is licensed under
# the MIT (Expat) license.
__version__ = '0.0.12'
__version__ = '0.0.13'
......@@ -244,21 +244,23 @@ class ReadlineShell(BaseShell, Cmd):
def completedefault(self, text, line, begidx, endidx):
"""Implements tab-completion for text."""
if self.completer is None:
return []
rl_completion_suppress_append() # this needs to be called each time
offset = 0
_s, _e, _q = check_for_partial_string(line)
if _s is not None:
mline = line[_s:]
if _e is not None and ' ' in line[_e:]:
mline = line.rpartition(' ')[2]
else:
mline = line[_s:]
else:
mline = line.rpartition(' ')[2]
offset = len(mline) - len(text)
if self.completer is None:
x = []
else:
comps = self.completer.complete(text, line,
begidx, endidx,
ctx=self.ctx)
x = [i[offset:] for i in comps[0]]
comps = self.completer.complete(text, line,
begidx, endidx,
ctx=self.ctx)
x = [i[offset:] for i in comps[0]]
return x
# tab complete on first index too
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment