From ebb839a35c99699c81190dd97f48ca2efb0e8500 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 12 Jan 2019 16:16:48 +0100 Subject: [PATCH] doxygen: properly prefer shorter prefix. The prefix_length is usually 0, since it's used for aliases, not indicating the actual prefix length. So use the whole result length instead. --- doxygen/dox2html5.py | 5 +++-- doxygen/test/test_search.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index e8028a82..ba290a3f 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -316,8 +316,9 @@ class Trie: # Third on suffix length (shortest first) entry.suffix_length, - # Lastly on prefix length (shortest first) - entry.prefix_length + # Lastly on full name length (or prefix length, also shortest + # first) + len(entry.name) ] self._sort(key) diff --git a/doxygen/test/test_search.py b/doxygen/test/test_search.py index e25c505b..c6b71c5f 100755 --- a/doxygen/test/test_search.py +++ b/doxygen/test/test_search.py @@ -465,9 +465,9 @@ class [20] | ) [12, 15, 19, 17] a group [29, 28] | page [52] -value [31, 41] +value [41, 31] | riable [48] -enum [34, 44] +enum [44, 34] | :$ | :deprecatedvalue [33] | onlyabrief [40] -- 2.30.2