Fix undue asserts in dmon_extra
Some asserts are placed in case that can effectively occur so we remove the assertion and we return false. In turn we adapt the logic accordingly so when false is returned to add a watch we do not open that directory.
This commit is contained in:
1 parent
5032e7352e
commit
7473fbf32c
3 files changed
+9
-11
No files matched your search
@@ -230,12 +230,14 @@ function TreeView:on_mouse_pressed(button, x, y, clicks)
|
||||
if keymap.modkeys["ctrl"] and button == "left" then
|
||||
create_directory_in(hovered_item)
|
||||
else
|
||||
hovered_item.expanded = not hovered_item.expanded
|
||||
local hovered_dir = core.project_dir_by_name(hovered_item.dir_name)
|
||||
if hovered_dir and hovered_dir.files_limit then
|
||||
core.update_project_subdir(hovered_dir, hovered_item.filename, hovered_item.expanded)
|
||||
core.project_subdir_set_show(hovered_dir, hovered_item.filename, hovered_item.expanded)
|
||||
if not core.project_subdir_set_show(hovered_dir, hovered_item.filename, not hovered_item.expanded) then
|
||||
return
|
||||
end
|
||||
core.update_project_subdir(hovered_dir, hovered_item.filename, not hovered_item.expanded)
|
||||
end
|
||||
hovered_item.expanded = not hovered_item.expanded
|
||||
end
|
||||
else
|
||||
core.try(function()
|
||||
|
||||
Reference in new issue
Block a user