From fde421b938f002f3485fcb7d6fc15173fe12825b Mon Sep 17 00:00:00 2001 From: "Mykolas A. Bamberg" Date: Mon, 30 Dec 2024 22:32:03 +0100 Subject: [PATCH] Sort entries alphabetically to ensure deterministic ordering --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 3dca60f..683456d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -141,7 +141,8 @@ pub fn get_matches(input: RString, state: &State) -> RVec { }) .collect::>(); - entries.sort_by(|a, b| b.2.cmp(&a.2)); + entries.sort_by(|a, b| b.2.cmp(&a.2) + .then(a.0.name.cmp(&b.0.name))); entries.truncate(state.config.max_entries); entries