try to get cdpath right

This commit is contained in:
adam j hartz 2016-05-31 16:45:50 -04:00
parent 67a7cac02a
commit 1b8c4804ba
3 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ def complete_base(prefix, line, start, end, ctx):
if line.strip() == '':
out = (complete_python(prefix, line, start, end, ctx) |
complete_command(prefix, line, start, end, ctx))
paths = complete_path(prefix, line, start, end, ctx)
paths = complete_path(prefix, line, start, end, ctx, False)
return (out | paths[0]), paths[1]
elif prefix == line:
return (complete_python(prefix, line, start, end, ctx) |

View file

@ -7,11 +7,11 @@ PREVENT_OTHERS = ['path']
def complete_cd(prefix, line, start, end, ctx):
if start != 0 and line.split(' ')[0] == 'cd':
return complete_dir(prefix, line, start, end, ctx)
return complete_dir(prefix, line, start, end, ctx, True)
return set()
def complete_rmdir(prefix, line, start, end, ctx):
if start != 0 and line.split(' ')[0] == 'rmdir':
return complete_dir(prefix, line, start, end, ctx)
return complete_dir(prefix, line, start, end, ctx, True)
return set()

View file

@ -150,7 +150,7 @@ def _quote_paths(paths, start, end):
return out
def complete_path(prefix, line, start, end, ctx, cdpath=False):
def complete_path(prefix, line, start, end, ctx, cdpath=True):
"""Completes based on a path name."""
# string stuff for automatic quoting
path_str_start = ''