Fix wrong locked sibling check

Previously if the split type was "hsplit", but `locked_size_x` was 
falsy, `locked_size_y` was wrongly used.
This commit is contained in:
Guldoman 2021-09-15 17:30:16 +02:00 committed by Francesco
parent 9bfec4aca5
commit 66bfff2e26
1 changed files with 7 additions and 2 deletions

View File

@ -143,8 +143,13 @@ 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 self.is_primary_node
or (parent.type == "hsplit" and locked_size_x or locked_size_y) then
local locked_size
if parent.type == "hsplit" then
locked_size = locked_size_x
else
locked_size = locked_size_y
end
if self.is_primary_node or locked_size then
self.views = {}
self:add_view(EmptyView())
else