From c2395f027882beed4d00f79e125afa30bcd367c6 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 12 Oct 2015 22:33:45 -0700 Subject: [PATCH] Sort manual search results shortest to longest --- docs/public/js/manual-search.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/public/js/manual-search.js b/docs/public/js/manual-search.js index 396f2e0..c2b13de 100644 --- a/docs/public/js/manual-search.js +++ b/docs/public/js/manual-search.js @@ -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) { -- 2.40.0