Simplify commit daf91676
about active view setting
This commit is contained in:
parent
456f6eda65
commit
7f4d9789d6
|
@ -613,17 +613,15 @@ function Node:close_all_docviews(keep_active)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.tab_offset = 1
|
self.tab_offset = 1
|
||||||
if #self.views == 0 then
|
if #self.views == 0 and self.is_primary_node then
|
||||||
if self.is_primary_node then
|
-- if we are not the primary view and we had the active view it doesn't
|
||||||
self:add_view(EmptyView())
|
-- matter to reattribute the active view because, within the close_all_docviews
|
||||||
elseif node_active_view == core.active_view then
|
-- top call, the primary node will take the active view anyway.
|
||||||
-- Apparently we never gets here. In practice the primary node
|
-- Set the empty view and takes the active view.
|
||||||
-- is cleared first and get the active view on the empty view it sets.
|
self:add_view(EmptyView())
|
||||||
local default_view = core.root_view:get_primary_node().views[1]
|
|
||||||
core.set_active_view(default_view)
|
|
||||||
end
|
|
||||||
elseif #self.views > 0 and lost_active_view then
|
elseif #self.views > 0 and lost_active_view then
|
||||||
-- We never get there either
|
-- In practice we never get there but if a view remain we need
|
||||||
|
-- to reset the Node's active view.
|
||||||
self:set_active_view(self.views[1])
|
self:set_active_view(self.views[1])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue