complete_dotted: fix for #361, filecompleter on dot files had differing behaviour from bash
Now if the prefix to expands ends in the directory seperator, then '..../.*' is globbed as well.
This commit is contained in:
parent
9b9355b8da
commit
236fff00ad
|
@ -74,9 +74,13 @@ class FastFilesCompleter:
|
||||||
else:
|
else:
|
||||||
prefix_dir = 0
|
prefix_dir = 0
|
||||||
completion = []
|
completion = []
|
||||||
|
globbed = []
|
||||||
if '*' not in prefix and '?' not in prefix:
|
if '*' not in prefix and '?' not in prefix:
|
||||||
|
if prefix[-1] == os.path.sep: # we are on unix, otherwise no bash
|
||||||
|
globbed.extend(glob(prefix + '.*'))
|
||||||
prefix += '*'
|
prefix += '*'
|
||||||
for x in sorted(glob(prefix)):
|
globbed.extend(glob(prefix))
|
||||||
|
for x in sorted(globbed):
|
||||||
if os.path.isdir(x):
|
if os.path.isdir(x):
|
||||||
x += '/'
|
x += '/'
|
||||||
# append stripping the prefix (like bash, not like compgen)
|
# append stripping the prefix (like bash, not like compgen)
|
||||||
|
|
Loading…
Reference in New Issue