Merge pull request #697 from Guldoman/treeview_remove_changed

Remove changed files/dirs from `TreeView` cache
This commit is contained in:
Adam 2021-11-26 22:07:19 -05:00 committed by GitHub
commit 4e078cc217
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -1156,7 +1156,7 @@ end
-- no-op but can be overrided by plugins
function core.on_dirmonitor_modify()
function core.on_dirmonitor_modify(dir, filepath)
end

View File

@ -42,6 +42,14 @@ function TreeView:new()
self.target_size = default_treeview_size
self.cache = {}
self.tooltip = { x = 0, y = 0, begin = 0, alpha = 0 }
local on_dirmonitor_modify = core.on_dirmonitor_modify
function core.on_dirmonitor_modify(dir, filepath)
if self.cache[dir.name] then
self.cache[dir.name][filepath] = nil
end
on_dirmonitor_modify(dir, filepath)
end
end