From f99afcd29c777544f1f3bc4f9d8b2802a5b15c5d Mon Sep 17 00:00:00 2001 From: Guldoman Date: Sun, 7 Nov 2021 23:12:03 +0100 Subject: [PATCH] In `TreeView` set correct active `View` before opening new `DocView` Before this, the new `DocView` was always added to the primary `Node`. With this, it gets added to the last focused `Node`. --- data/plugins/treeview.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/plugins/treeview.lua b/data/plugins/treeview.lua index d08db03e..77b6732f 100644 --- a/data/plugins/treeview.lua +++ b/data/plugins/treeview.lua @@ -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)