|
|
@ -47,11 +47,6 @@ function ReadHistory:_indexing(start)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReadHistory:_sort()
|
|
|
|
function ReadHistory:_sort()
|
|
|
|
for i = #self.hist, 1, -1 do
|
|
|
|
|
|
|
|
if self.hist[i].file == nil or lfs.attributes(self.hist[i].file, "mode") ~= "file" then
|
|
|
|
|
|
|
|
table.remove(self.hist, i)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
table.sort(self.hist, fileFirstOrdering)
|
|
|
|
table.sort(self.hist, fileFirstOrdering)
|
|
|
|
-- TODO(zijiehe): Use binary insert instead of a loop to deduplicate.
|
|
|
|
-- TODO(zijiehe): Use binary insert instead of a loop to deduplicate.
|
|
|
|
for i = #self.hist, 2, -1 do
|
|
|
|
for i = #self.hist, 2, -1 do
|
|
|
@ -122,6 +117,14 @@ function ReadHistory:_init()
|
|
|
|
self:_reduce()
|
|
|
|
self:_reduce()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ReadHistory:clearMissing()
|
|
|
|
|
|
|
|
for i = #self.hist, 1, -1 do
|
|
|
|
|
|
|
|
if self.hist[i].file == nil or lfs.attributes(self.hist[i].file, "mode") ~= "file" then
|
|
|
|
|
|
|
|
table.remove(self.hist, i)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReadHistory:removeItem(item)
|
|
|
|
function ReadHistory:removeItem(item)
|
|
|
|
table.remove(self.hist, item.index)
|
|
|
|
table.remove(self.hist, item.index)
|
|
|
|
os.remove(DocSettings:getHistoryPath(item.file))
|
|
|
|
os.remove(DocSettings:getHistoryPath(item.file))
|
|
|
|