pull/466/merge
Hari Pachuveetil 8 months ago committed by GitHub
commit 1a277ca2e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,7 @@
NAME
----
autojump - a faster way to navigate your filesystem
autojump - a faster way to navigate your filesystem [![Build Status](https://travis-ci.org/floydpink/autojump.svg?branch=master)](https://travis-ci.org/floydpink/autojump)
DESCRIPTION
-----------

@ -75,9 +75,10 @@ def match_consecutive(needles, haystack, ignore_case=False):
(path='/foo/baz', weight=10),
]
"""
regex_no_sep = '[^' + os.sep + ']*'
sep = '\\\\' if os.sep == '\\' else os.sep
regex_no_sep = '[^' + sep + ']*'
regex_no_sep_end = regex_no_sep + '$'
regex_one_sep = regex_no_sep + os.sep + regex_no_sep
regex_one_sep = regex_no_sep + sep + regex_no_sep
regex_needle = regex_one_sep.join(imap(re.escape, needles)) + regex_no_sep_end
regex_flags = re.IGNORECASE | re.UNICODE if ignore_case else re.UNICODE
found = lambda entry: re.search(

Loading…
Cancel
Save