mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 09:32:21 +00:00
Do not complete 'cd' to non-path elements
This commit is contained in:
parent
feb8c68ad4
commit
26c95349fc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user