Do not try to update topdir folder in treeview
If the directory expanded is a project's top directory do not attempt to update its content. Fix again issue #275
This commit is contained in:
parent
4c9083398a
commit
1ad4289e76
|
@ -195,6 +195,16 @@ local function project_scan_thread()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function core.is_project_folder(dirname)
|
||||||
|
for _, dir in ipairs(core.project_directories) do
|
||||||
|
if dir.name == dirname then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function core.scan_project_folder(dirname, filename)
|
function core.scan_project_folder(dirname, filename)
|
||||||
for _, dir in ipairs(core.project_directories) do
|
for _, dir in ipairs(core.project_directories) do
|
||||||
if dir.name == dirname then
|
if dir.name == dirname then
|
||||||
|
|
|
@ -231,8 +231,10 @@ function TreeView:on_mouse_pressed(button, x, y, clicks)
|
||||||
-- we assume here index is not nil because the abs_filename must contain the
|
-- we assume here index is not nil because the abs_filename must contain the
|
||||||
-- relative filename
|
-- relative filename
|
||||||
local dirname = string.sub(abs_filename, 1, index - 2)
|
local dirname = string.sub(abs_filename, 1, index - 2)
|
||||||
core.scan_project_folder(dirname, filename)
|
if core.is_project_folder(dirname) then
|
||||||
self:invalidate_cache(dirname)
|
core.scan_project_folder(dirname, filename)
|
||||||
|
self:invalidate_cache(dirname)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
hovered_item.expanded = not hovered_item.expanded
|
hovered_item.expanded = not hovered_item.expanded
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue