From fdeedb4f70aced817c4dc316ccb253af72b6f551 Mon Sep 17 00:00:00 2001 From: William Ting Date: Tue, 17 Dec 2013 09:35:14 -0600 Subject: [PATCH] add multiple argument exact match support --- bin/autojump | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/autojump b/bin/autojump index 5d1c69f..67dbb1f 100755 --- a/bin/autojump +++ b/bin/autojump @@ -191,16 +191,15 @@ def find_matches(config, needles, count=1): key=attrgetter('weight'), reverse=True) - print(data[:3]) - - # if no arguments, return first path if not needles: return first(data).path 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