Remove the treeview check for modified files

In the treeview the implementation was checking the files list
to detect if it changed because of a project scan. Since we removed
the project scan we no longer need the check.

Removed the TreeView's self.last table that stores previous files
object by top-level directories.
This commit is contained in:
Francesco Abbate 2021-07-14 23:15:05 +02:00
parent 7ee00c3317
commit 0d1bec8e35
1 changed files with 2 additions and 9 deletions

View File

@ -41,7 +41,6 @@ function TreeView:new()
self.init_size = true
self.target_size = default_treeview_size
self.cache = {}
self.last = {}
self.tooltip = { x = 0, y = 0, begin = 0, alpha = 0 }
end
@ -107,14 +106,8 @@ function TreeView:check_cache()
-- invalidate cache's skip values if project_files has changed
for i = 1, #core.project_directories do
local dir = core.project_directories[i]
local last_files = self.last[dir.name]
if not last_files then
self.last[dir.name] = dir.files
else
if dir.is_dirty or dir.files ~= last_files then
self:invalidate_cache(dir.name)
self.last[dir.name] = dir.files
end
if dir.is_dirty and self.cache[dir.name] then
self:invalidate_cache(dir.name)
end
dir.is_dirty = false
end