Fixed treeview clicking not being caught.

This commit is contained in:
Adam Harrison 2021-12-11 17:51:19 -05:00 committed by Guldoman
parent 4f079918c9
commit 436c496d77
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
2 changed files with 3 additions and 2 deletions

BIN
data/plugins/test.so Executable file

Binary file not shown.

View File

@ -219,11 +219,11 @@ end
function TreeView:on_mouse_pressed(button, x, y, clicks)
local caught = TreeView.super.on_mouse_pressed(self, button, x, y, clicks)
if caught or button ~= "left" then
return
return true
end
local hovered_item = self.hovered_item
if not hovered_item then
return
return false
elseif hovered_item.type == "dir" then
if keymap.modkeys["ctrl"] and button == "left" then
create_directory_in(hovered_item)
@ -243,6 +243,7 @@ function TreeView:on_mouse_pressed(button, x, y, clicks)
core.root_view:open_doc(core.open_doc(doc_filename))
end)
end
return true
end