mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
remove zsh tab completion redundant code
This commit is contained in:
parent
e21292e573
commit
2b6cfe7cdf
22
bin/autojump
22
bin/autojump
@ -211,7 +211,7 @@ class Database:
|
|||||||
def set_defaults():
|
def set_defaults():
|
||||||
config = {}
|
config = {}
|
||||||
|
|
||||||
config['version'] = 'release-v21.6.2'
|
config['version'] = 'release-v21.6.3'
|
||||||
config['max_weight'] = 1000
|
config['max_weight'] = 1000
|
||||||
config['max_paths'] = 1000
|
config['max_paths'] = 1000
|
||||||
config['separator'] = '__'
|
config['separator'] = '__'
|
||||||
@ -364,21 +364,6 @@ def unico(text):
|
|||||||
else:
|
else:
|
||||||
return unicode(text)
|
return unicode(text)
|
||||||
|
|
||||||
def match_last(config, pattern):
|
|
||||||
"""
|
|
||||||
If the last pattern contains a full path, jump there.
|
|
||||||
The regexp is because we need to support stuff like
|
|
||||||
"j wo jo__3__/home/joel/workspace/joel" for zsh.
|
|
||||||
"""
|
|
||||||
last_pattern_path = re.sub("(.*)"+config['separator'], "", pattern[-1])
|
|
||||||
if (len(last_pattern_path) > 0 and
|
|
||||||
last_pattern_path[0] == "/" and
|
|
||||||
os.path.exists(last_pattern_path)):
|
|
||||||
if not config['args'].complete:
|
|
||||||
output(last_pattern_path)
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def match(path, pattern, only_end=False, ignore_case=False):
|
def match(path, pattern, only_end=False, ignore_case=False):
|
||||||
"""
|
"""
|
||||||
Check whether a path matches a particular pattern, and return
|
Check whether a path matches a particular pattern, and return
|
||||||
@ -486,11 +471,6 @@ def main():
|
|||||||
else:
|
else:
|
||||||
patterns = [unico('')]
|
patterns = [unico('')]
|
||||||
|
|
||||||
# check last pattern for full path
|
|
||||||
# FIXME: disabled until zsh tab completion is fixed on the shell side
|
|
||||||
# if match_last(config, patterns):
|
|
||||||
# return True
|
|
||||||
|
|
||||||
# check for tab completion
|
# check for tab completion
|
||||||
tab_choice = -1
|
tab_choice = -1
|
||||||
tab_match = re.search(config['separator']+"([0-9]+)", patterns[-1])
|
tab_match = re.search(config['separator']+"([0-9]+)", patterns[-1])
|
||||||
|
Loading…
Reference in New Issue
Block a user