From 36fcadd18f81cb18cdf20de14b5bd1f289605ab9 Mon Sep 17 00:00:00 2001 From: Christopher Musselle Date: Tue, 26 Feb 2019 23:55:20 +0000 Subject: [PATCH] Impliment fix in #436 --- bin/autojump_match.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/autojump_match.py b/bin/autojump_match.py index 8747b90..1788d32 100644 --- a/bin/autojump_match.py +++ b/bin/autojump_match.py @@ -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(