aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/core/rootview.lua4
-rw-r--r--data/plugins/treeview.lua1
2 files changed, 4 insertions, 1 deletions
diff --git a/data/core/rootview.lua b/data/core/rootview.lua
index d6bf876f..859b41c6 100644
--- a/data/core/rootview.lua
+++ b/data/core/rootview.lua
@@ -386,6 +386,10 @@ end
function RootView:open_doc(doc)
local node = self:get_active_node()
+ if node.locked and core.last_active_view then
+ core.set_active_view(core.last_active_view)
+ node = self:get_active_node()
+ end
assert(not node.locked, "Cannot open doc on locked node")
for i, view in ipairs(node.views) do
if view.doc == doc then
diff --git a/data/plugins/treeview.lua b/data/plugins/treeview.lua
index d22db0f7..8aa53ffc 100644
--- a/data/plugins/treeview.lua
+++ b/data/plugins/treeview.lua
@@ -111,7 +111,6 @@ end
function TreeView:on_mouse_pressed(button, x, y)
- core.set_active_view(core.last_active_view)
if not self.hovered_item then
return
elseif self.hovered_item.type == "dir" then