|
|
@ -200,7 +200,7 @@ function ReadHistory:clearMissing()
|
|
|
|
assert(self ~= nil)
|
|
|
|
assert(self ~= nil)
|
|
|
|
for i = #self.hist, 1, -1 do
|
|
|
|
for i = #self.hist, 1, -1 do
|
|
|
|
if self.hist[i].file == nil or lfs.attributes(self.hist[i].file, "mode") ~= "file" then
|
|
|
|
if self.hist[i].file == nil or lfs.attributes(self.hist[i].file, "mode") ~= "file" then
|
|
|
|
table.remove(self.hist, i)
|
|
|
|
self:removeItem(self.hist[i], i)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
self:ensureLastFile()
|
|
|
|
self:ensureLastFile()
|
|
|
@ -237,11 +237,11 @@ function ReadHistory:updateItemByPath(old_path, new_path)
|
|
|
|
self:ensureLastFile()
|
|
|
|
self:ensureLastFile()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReadHistory:removeItem(item)
|
|
|
|
function ReadHistory:removeItem(item, idx)
|
|
|
|
assert(self ~= nil)
|
|
|
|
assert(self ~= nil)
|
|
|
|
table.remove(self.hist, item.index)
|
|
|
|
table.remove(self.hist, item.index or idx)
|
|
|
|
os.remove(DocSettings:getHistoryPath(item.file))
|
|
|
|
os.remove(DocSettings:getHistoryPath(item.file))
|
|
|
|
self:_indexing(item.index)
|
|
|
|
self:_indexing(item.index or idx)
|
|
|
|
self:_flush()
|
|
|
|
self:_flush()
|
|
|
|
self:ensureLastFile()
|
|
|
|
self:ensureLastFile()
|
|
|
|
end
|
|
|
|
end
|
|
|
|