We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ef8ca4 commit fda43afCopy full SHA for fda43af
internal/views/splits.go
@@ -483,7 +483,20 @@ func (n *Node) Unsplit() bool {
483
// flattens the tree by removing unnecessary intermediate parents that have only one child
484
// and handles the side effect of it
485
func (n *Node) flatten() {
486
- if n.parent == nil || len(n.children) != 1 {
+ if len(n.children) != 1 {
487
+ return
488
+ }
489
+
490
+ // Special case for root node
491
+ if n.parent == nil {
492
+ *n = *n.children[0]
493
+ n.parent = nil
494
+ for _, c := range n.children {
495
+ c.parent = n
496
497
+ if len(n.children) == 0 {
498
+ n.Kind = STUndef
499
500
return
501
}
502
0 commit comments