1
0
mirror of https://github.com/wting/autojump synced 2026-03-02 03:49:26 +00:00

fix zsh tab completion

This commit is contained in:
William Ting
2013-12-30 17:44:39 -06:00
parent bec6314eab
commit 6293af5b7a
4 changed files with 71 additions and 70 deletions

View File

@@ -65,17 +65,22 @@ def get_tab_needle_and_path(tab_entry, separator):
[needle]__[index]__[path]
"""
matches = re.search(
r'(.*?)' +
separator +
r'[0-9]{1}' +
separator +
r'(.*)',
match_needle = re.search(r'(.*?)' + separator, tab_entry)
match_path = re.search(
separator + r'[0-9]{1}' + separator + r'(.*)',
tab_entry)
if matches:
return matches.groups()
return None, None
if match_needle:
tab_needle = match_needle.group(1)
else:
tab_needle = None
if match_path:
path = match_path.group(1)
else:
path = None
return tab_needle, path
def get_pwd():