new history, changed sorting of names for autocompletion

This commit is contained in:
Manuel Simon Hirsig
2016-02-08 04:13:54 +01:00
parent 8a0ee6ff38
commit d7a310a7c0
7 changed files with 119 additions and 115 deletions
+6 -13
View File
@@ -1,17 +1,9 @@
local DATABASE_VERSION = 0
local private, public = {}, {}
Aux.persistence = public
aux_database = {}
function public.on_load()
private.perform_migration(aux_database)
aux_database.version = DATABASE_VERSION
end
function private.perform_migration()
end
function private.get_dataset_key()
@@ -30,13 +22,14 @@ function public.serialize(data, separator, compactor)
local data_string = ''
local i = 1
while i <= getn(data) do
local element, count = data[i], 0
repeat
local element, count = data[i], 1
while compactor and data[i + 1] == element do
count = count + 1
i = i + 1
until (not compactor) or data[i] ~= element
local part = (count > 1 and compactor) and element..compactor..count or element
data_string = data_string..(data_string == '' and '' or separator)..part
end
local part = count > 1 and element..compactor..count or element
data_string = data_string..(i == 1 and '' or separator)..part
i = i + 1
end
return data_string