We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a87f3dd commit 0a07c9eCopy full SHA for 0a07c9e
internal/views/splits.go
@@ -483,7 +483,14 @@ 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.Kind = STUndef
493
+ n.children = n.children[:0]
494
return
495
}
496
0 commit comments