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 7aca4e6ba2
commit 7b7dfe8c75
1 changed files with 2 additions and 9 deletions

View File

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