mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
first attempt: modify completer to add quotes where necessary
This commit is contained in:
parent
f5c810fe9b
commit
350e0b9813
1 changed files with 9 additions and 2 deletions
|
@ -107,8 +107,15 @@ class Completer(object):
|
|||
space = ' ' # intern some strings for faster appending
|
||||
slash = '/'
|
||||
tilde = '~'
|
||||
paths = {s + (slash if os.path.isdir(s) else space) \
|
||||
for s in iglobpath(prefix + '*')}
|
||||
paths = set()
|
||||
if prefix.startswith("'") or prefix.startswith('"'):
|
||||
prefix = prefix[1:]
|
||||
for s in iglobpath(prefix + '*'):
|
||||
if space in s:
|
||||
s = repr(s + (slash if os.path.isdir(s) else ''))
|
||||
else:
|
||||
s = s + (slash if os.path.isdir(s) else space)
|
||||
paths.add(s)
|
||||
if tilde in prefix:
|
||||
home = os.path.expanduser(tilde)
|
||||
paths = {s.replace(home, tilde) for s in paths}
|
||||
|
|
Loading…
Add table
Reference in a new issue