1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

disable regexes

Rationale: regexes in the dirspec break autojump for weird directory
names like "c++". In more than one year of use, I've never even been
tempted to use a regexp with autojump. So I think it is safe to remove
this feature. If enough users shout, I will revert this change.
This commit is contained in:
Joel Schaerer 2010-04-25 23:55:18 +02:00
parent f59aab321c
commit 3b5b52d610

View File

@ -36,12 +36,14 @@ def dicadd(dic,key,increment=1):
dic[key]=dic.get(key,0.)+increment
def match(path,pattern,path_dict,re_flags=0):
import re
try:
if os.path.realpath(os.curdir)==path : return False
except OSError: #sometimes the current path doesn't exist anymore. In that case, jump if possible.
pass
if re.search(pattern,"/".join(path.split('/')[-1-pattern.count('/'):]),re_flags) is None:
match_string = "/".join(path.split('/')[-1-pattern.count('/'):])
#import re
#if re.search(pattern,match_string),re_flags) is None:
if match_string.find(pattern) == -1:
return False
else:
if os.path.exists(path) : return True