mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
add multiple argument exact match support
This commit is contained in:
parent
4c432fc5f1
commit
fdeedb4f70
@ -191,16 +191,15 @@ def find_matches(config, needles, count=1):
|
|||||||
key=attrgetter('weight'),
|
key=attrgetter('weight'),
|
||||||
reverse=True)
|
reverse=True)
|
||||||
|
|
||||||
print(data[:3])
|
|
||||||
|
|
||||||
# if no arguments, return first path
|
|
||||||
if not needles:
|
if not needles:
|
||||||
return first(data).path
|
return first(data).path
|
||||||
|
|
||||||
sanitize = lambda x: decode(x).rstrip(os.sep)
|
sanitize = lambda x: decode(x).rstrip(os.sep)
|
||||||
needle = first(imap(sanitize, needles))
|
needles = imap(sanitize, needles)
|
||||||
|
|
||||||
exact_matches = match_exact(needle, data)
|
exact_matches = data
|
||||||
|
for needle in needles:
|
||||||
|
exact_matches = match_exact(needle, exact_matches)
|
||||||
|
|
||||||
return first(exact_matches).path
|
return first(exact_matches).path
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user