Skip to content

Commit 208d090

Browse files
Merge branch 'ChainedParentsFix' into dev
2 parents 9f9012f + d76c0b0 commit 208d090

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

internal/views/splits.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,12 @@ func (n *Node) VSplit(right bool) uint64 {
439439
}
440440

441441
// unsplits the child of a split
442-
func (n *Node) unsplit(i int, h bool) {
442+
func (n *Node) unsplit(i int) {
443443
copy(n.children[i:], n.children[i+1:])
444444
n.children[len(n.children)-1] = nil
445445
n.children = n.children[:len(n.children)-1]
446446

447+
h := n.Kind == STVert
447448
nonrs, numr := n.getResizeInfo(h)
448449
if numr == 0 {
449450
// This means that this was the last child
@@ -470,12 +471,7 @@ func (n *Node) Unsplit() bool {
470471
ind = i
471472
}
472473
}
473-
if n.parent.Kind == STVert {
474-
n.parent.unsplit(ind, true)
475-
} else {
476-
n.parent.unsplit(ind, false)
477-
}
478-
474+
n.parent.unsplit(ind)
479475
if n.parent.IsLeaf() {
480476
return n.parent.Unsplit()
481477
}
@@ -487,6 +483,7 @@ func (n *Node) Unsplit() bool {
487483
// Simplify removes unnecessary chained parents
488484
func (n *Node) simplify() {
489485
if n.parent == nil || len(n.children) != 1 {
486+
n.markResize()
490487
return
491488
}
492489

0 commit comments

Comments
 (0)