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:
parent
f59aab321c
commit
3b5b52d610
6
autojump
6
autojump
@ -36,12 +36,14 @@ def dicadd(dic,key,increment=1):
|
|||||||
dic[key]=dic.get(key,0.)+increment
|
dic[key]=dic.get(key,0.)+increment
|
||||||
|
|
||||||
def match(path,pattern,path_dict,re_flags=0):
|
def match(path,pattern,path_dict,re_flags=0):
|
||||||
import re
|
|
||||||
try:
|
try:
|
||||||
if os.path.realpath(os.curdir)==path : return False
|
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.
|
except OSError: #sometimes the current path doesn't exist anymore. In that case, jump if possible.
|
||||||
pass
|
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
|
return False
|
||||||
else:
|
else:
|
||||||
if os.path.exists(path) : return True
|
if os.path.exists(path) : return True
|
||||||
|
Loading…
Reference in New Issue
Block a user