1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

handle no results situation

This commit is contained in:
William Ting 2013-12-17 11:04:44 -06:00
parent 1a2a5a86f6
commit c2189efb7b

View File

@ -212,7 +212,8 @@ def find_matches(config, needles, count=1):
exact_matches = match_regex(needles, data, ignore_case) exact_matches = match_regex(needles, data, ignore_case)
exists = lambda entry: os.path.exists(entry.path) exists = lambda entry: os.path.exists(entry.path)
return first(ifilter(exists, exact_matches)).path result = first(ifilter(exists, exact_matches))
return result.path if result else u''
def match_end(needle, haystack, ignore_case=False): def match_end(needle, haystack, ignore_case=False):