aboutsummaryrefslogtreecommitdiffstats
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 817279c..4bac6b0 100644
--- a/init.lua
+++ b/init.lua
@@ -102,12 +102,20 @@ end
local function preprocess(tbl)
local cfg, ord = {}, P(false)
+ local longer_first = {}
for _, options in ipairs(tbl) do
for i, key in ipairs(options) do
cfg[key] = {i, options}
- ord = ord + key
+ table.insert(longer_first, key)
end
end
+ table.sort(longer_first, function(f, s)
+ local flen, slen = #f, #s
+ return flen > slen or flen == slen and f < s
+ end)
+ for _, key in ipairs(longer_first) do
+ ord = ord + key
+ end
return cfg, ord
end