1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Sort manual search results shortest to longest

This commit is contained in:
David Tolnay
2015-10-12 22:33:45 -07:00
parent 0791261f07
commit c2395f0278

View File

@@ -6,6 +6,10 @@ var section_names = function(q, cb) {
matches.push(k);
}
});
matches.sort(function(a, b) {
// shortest to longest
return a.length - b.length;
});
cb(matches);
}
var go_to_section = function(section) {