1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00
This commit is contained in:
Lei Xiaopeng 2023-08-29 14:10:09 +10:00 committed by GitHub
commit 7aa84b7323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,7 @@ def match_consecutive(needles, haystack, ignore_case=False):
(path='/foo/baz', weight=10),
]
"""
regex_no_sep = '[^' + os.sep + ']*'
regex_no_sep = '[^\\' + os.sep + ']*'
regex_no_sep_end = regex_no_sep + '$'
regex_one_sep = regex_no_sep + os.sep + regex_no_sep
regex_needle = regex_one_sep.join(imap(re.escape, needles)) + regex_no_sep_end