From 7b7dfe8c7555c8aed94ac0360f4340cb06b03cc9 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Wed, 14 Jul 2021 23:15:05 +0200 Subject: [PATCH] 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. --- data/plugins/treeview.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/data/plugins/treeview.lua b/data/plugins/treeview.lua index 4f3b80af..3fa38579 100644 --- a/data/plugins/treeview.lua +++ b/data/plugins/treeview.lua @@ -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