Avoid references to project's dir in TreeView
It is not a good practice to keep a reference to the project's directory object outside of the "core" module itself. The TreeView was using such a reference in the cache item for each file or directory entry. Replace the reference to the object with the absolute name of the project directory.
This commit is contained in:
@@ -371,6 +371,15 @@ function core.add_project_directory(path)
|
||||
end
|
||||
|
||||
|
||||
function core.project_dir_by_name(name)
|
||||
for i = 1, #core.project_directories do
|
||||
if core.project_directories[i].name == name then
|
||||
return core.project_directories[i]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function core.update_project_subdir(dir, filename, expanded)
|
||||
local index, n, file = project_subdir_bounds(dir, filename)
|
||||
if index then
|
||||
|
||||
Reference in New Issue
Block a user