Prevent os.path.normpath from removing initial ‘./’

Closes #307.
This commit is contained in:
Klaus Alexander Seistrup 2015-07-31 17:14:56 +02:00
parent a570397faf
commit 205d0ae551

View file

@ -35,6 +35,12 @@ for ((i=0;i<${{#COMPREPLY[*]}};i++)) do echo ${{COMPREPLY[i]}}; done
"""
def _normpath(p):
if p.startswith('./'):
return './' + os.path.normpath(p)
return os.path.normpath(p)
class Completer(object):
"""This provides a list of optional completions for the xonsh shell."""
@ -173,7 +179,7 @@ class Completer(object):
self._add_dots(paths, prefix)
if cdpath:
self._add_cdpaths(paths, prefix)
return {os.path.normpath(s) for s in paths}
return {_normpath(s) for s in paths}
def bash_complete(self, prefix, line, begidx, endidx):
"""Attempts BASH completion."""