mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
bin/autojump: Make the test pass
The order of completion suggestions must be according to the weights, yet `set` is unordered. Thus, sorting needs to be performed after de-duplicating. Fixes https://github.com/wting/autojump/issues/348
This commit is contained in:
parent
4e11af9f12
commit
54e5cb0356
17
bin/autojump
17
bin/autojump
@ -188,18 +188,15 @@ def find_matches(entries, needles, check_entries=True):
|
||||
else:
|
||||
path_exists = lambda _: True
|
||||
|
||||
data = sorted(
|
||||
entries,
|
||||
key=attrgetter('weight', 'path'),
|
||||
reverse=True,
|
||||
)
|
||||
|
||||
return ifilter(
|
||||
lambda entry: not is_cwd(entry) and path_exists(entry),
|
||||
chain(
|
||||
match_consecutive(needles, data, ignore_case),
|
||||
match_fuzzy(needles, data, ignore_case),
|
||||
match_anywhere(needles, data, ignore_case),
|
||||
sorted(
|
||||
set(chain(
|
||||
match_consecutive(needles, entries, ignore_case),
|
||||
match_fuzzy(needles, entries, ignore_case),
|
||||
match_anywhere(needles, entries, ignore_case),
|
||||
)), key=attrgetter('weight', 'path'),
|
||||
reverse=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user