From 3844d7639f70e1e16276d54067148a47ab3a50fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henr=C3=A9=20Botha?= Date: Wed, 18 Mar 2026 12:20:39 +0100 Subject: [PATCH] Sort keyFuncNameTable entries consistently --- Source/RecursiveBinder.spoon/init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/RecursiveBinder.spoon/init.lua b/Source/RecursiveBinder.spoon/init.lua index 45f59dce..8d473256 100644 --- a/Source/RecursiveBinder.spoon/init.lua +++ b/Source/RecursiveBinder.spoon/init.lua @@ -199,7 +199,15 @@ local function showHelper(keyFuncNameTable) local separator = '' -- first loop doesn't need to add a separator, because it is in the very front. local lastLine = '' local count = 0 - for keyName, funcName in pairs(keyFuncNameTable) do + local keysSorted = {} + for k, v in pairs(keyFuncNameTable) do + table.insert(keysSorted, {key = k, value = v}) + end + table.sort(keysSorted, function(a, b) return a.value < b.value end) + + for i = 1, #keysSorted do + local keyName = keysSorted[i].key + local funcName = keysSorted[i].value local newEntry = keyName..' → '..funcName -- make sure each entry is of the same length if string.len(newEntry) > obj.helperEntryLengthInChar then