File tree Expand file tree Collapse file tree 1 file changed +21
-14
lines changed Expand file tree Collapse file tree 1 file changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -1275,10 +1275,11 @@ impl<'r> Tree<'r> {
1275
1275
}
1276
1276
tree. push ( stack_tree) ;
1277
1277
} else {
1278
- if i != 0 && !stack. is_empty ( ) {
1279
- tree. push ( termtree:: Tree :: root ( joint) . with_glyphs ( SPACE_GLYPHS ) ) ;
1280
- }
1281
- for child_tree in stack. into_iter ( ) {
1278
+ let stack_len = stack. len ( ) ;
1279
+ for ( j, child_tree) in stack. into_iter ( ) . enumerate ( ) {
1280
+ if i != 0 && j == 0 {
1281
+ tree. push ( termtree:: Tree :: root ( joint) . with_glyphs ( SPACE_GLYPHS ) ) ;
1282
+ }
1282
1283
let child = RenderNode {
1283
1284
repo,
1284
1285
head_branch,
@@ -1287,17 +1288,23 @@ impl<'r> Tree<'r> {
1287
1288
palette,
1288
1289
} ;
1289
1290
tree. push ( termtree:: Tree :: root ( child) . with_glyphs ( GLYPHS ) ) ;
1290
- for child_stack in child_tree. stacks . into_iter ( ) {
1291
- let mut stack_tree = termtree:: Tree :: root ( joint) . with_glyphs ( JOINT_GLYPHS ) ;
1292
- for child_tree in child_stack. into_iter ( ) {
1293
- stack_tree. push ( child_tree. into_display (
1294
- repo,
1295
- head_branch,
1296
- protected_branches,
1297
- palette,
1298
- ) ) ;
1291
+ if !child_tree. stacks . is_empty ( ) {
1292
+ for child_stack in child_tree. stacks . into_iter ( ) {
1293
+ let mut stack_tree =
1294
+ termtree:: Tree :: root ( joint) . with_glyphs ( JOINT_GLYPHS ) ;
1295
+ for child_tree in child_stack. into_iter ( ) {
1296
+ stack_tree. push ( child_tree. into_display (
1297
+ repo,
1298
+ head_branch,
1299
+ protected_branches,
1300
+ palette,
1301
+ ) ) ;
1302
+ }
1303
+ tree. push ( stack_tree) ;
1304
+ }
1305
+ if j < stack_len {
1306
+ tree. push ( termtree:: Tree :: root ( joint) . with_glyphs ( SPACE_GLYPHS ) ) ;
1299
1307
}
1300
- tree. push ( stack_tree) ;
1301
1308
}
1302
1309
}
1303
1310
}
You can’t perform that action at this time.
0 commit comments