Merge pull request #661 from Guldoman/open_in_right_node

In `TreeView` add `DocView` to the correct `Node`
This commit is contained in:
Adam 2021-11-07 17:19:23 -05:00 committed by GitHub
commit 3b38e7c351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -225,6 +225,9 @@ function TreeView:on_mouse_pressed(button, x, y, clicks)
end
else
core.try(function()
if core.last_active_view and core.active_view == self then
core.set_active_view(core.last_active_view)
end
local doc_filename = core.normalize_to_project_dir(hovered_item.abs_filename)
core.root_view:open_doc(core.open_doc(doc_filename))
end)