mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 09:20:57 +01:00
try to get cdpath right
This commit is contained in:
parent
67a7cac02a
commit
1b8c4804ba
3 changed files with 4 additions and 4 deletions
|
@ -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) |
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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 = ''
|
||||
|
|
Loading…
Add table
Reference in a new issue