Ensure that the primary node always has a `View`

This commit is contained in:
Guldoman 2021-09-15 03:46:29 +02:00 committed by Francesco
parent fb955e4e12
commit 9bfec4aca5
1 changed files with 2 additions and 1 deletions

View File

@ -143,7 +143,8 @@ function Node:remove_view(root, view)
local is_a = (parent.a == self)
local other = parent[is_a and "b" or "a"]
local locked_size_x, locked_size_y = other:get_locked_size()
if (parent.type == "hsplit" and locked_size_x or locked_size_y) then
if self.is_primary_node
or (parent.type == "hsplit" and locked_size_x or locked_size_y) then
self.views = {}
self:add_view(EmptyView())
else