2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Do not complete 'cd' to non-path elements

This commit is contained in:
Jarrod Johnson 2014-02-22 12:24:22 -05:00
parent feb8c68ad4
commit 26c95349fc

View File

@ -105,6 +105,7 @@ def rcompleter(text, state):
else:
foundcount += 1
return None
cmd = args[0]
if candidates is None:
candidates = []
targpath = fullpath_target(args[-1])
@ -117,6 +118,8 @@ def rcompleter(text, state):
candidates.append(item["href"])
foundcount = 0
for elem in candidates:
if cmd == 'cd' and elem[-1] != '/':
continue
if elem.startswith(text):
if foundcount == state:
return elem