Skip to content

Commit

Permalink
fixes wting#436 - the suggested patch on the issue description
Browse files Browse the repository at this point in the history
  • Loading branch information
Haridas Pachuveetil authored and glucas committed Feb 5, 2018
1 parent 6a529f4 commit d032271
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/autojump_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d032271

Please sign in to comment.