diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 |