diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 3a9659009..eb39e9122 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1455,6 +1455,7 @@ void ncplane_move_bottom(ncplane* n){ // if above is NULL, we're moving to the bottom void ncplane_move_family_above(ncplane* restrict n, ncplane* restrict bpoint){ ncplane* above = ncplane_above(n); + ncplane* below = ncplane_below(n); ncplane_move_above(n, bpoint); // traverse the planes above n, until we hit NULL. do the planes above n // first, so that we know the topmost element of our new ensplicification. @@ -1472,7 +1473,6 @@ void ncplane_move_family_above(ncplane* restrict n, ncplane* restrict bpoint){ // careful this time not to cross into any we moved below n. const ncplane* topmost = targ; targ = n; - ncplane* below = ncplane_below(n); while(below && below != topmost){ ncplane* tmp = ncplane_below(below); if(ncplane_descendant_p(below, n)){ @@ -1486,6 +1486,7 @@ void ncplane_move_family_above(ncplane* restrict n, ncplane* restrict bpoint){ // if below is NULL, we're moving to the top void ncplane_move_family_below(ncplane* restrict n, ncplane* restrict bpoint){ ncplane* below = ncplane_below(n); + ncplane* above = ncplane_above(n); ncplane_move_below(n, bpoint); // traverse the planes below n, until we hit NULL. do the planes below n // first, so that we know the bottommost element of our new ensplicification. @@ -1503,7 +1504,6 @@ void ncplane_move_family_below(ncplane* restrict n, ncplane* restrict bpoint){ // careful this time not to cross into any we moved below n. const ncplane* bottommost = targ; targ = n; - ncplane* above = ncplane_above(n); while(above && above != bottommost){ ncplane* tmp = ncplane_above(above); if(ncplane_descendant_p(above, n)){ diff --git a/src/tests/zaxis.cpp b/src/tests/zaxis.cpp index 3174379c9..535c776b2 100644 --- a/src/tests/zaxis.cpp +++ b/src/tests/zaxis.cpp @@ -225,14 +225,13 @@ TEST_CASE("ZAxis") { CHECK(ncplane_below(e) == n_); CHECK(ncpile_bottom(n_) == n_); ncplane_move_family_bottom(c); - // ABDsCE, E is bound to C (FIXME have ABDEsC) CHECK(ncpile_top(n_) == a); CHECK(ncplane_below(a) == b); CHECK(ncplane_below(b) == d); - CHECK(ncplane_below(d) == e); - CHECK(ncplane_below(e) == n_); + CHECK(ncplane_below(d) == n_); CHECK(ncplane_below(n_) == c); - CHECK(ncpile_bottom(n_) == c); + CHECK(ncplane_below(c) == e); + CHECK(ncpile_bottom(n_) == e); } CHECK(0 == notcurses_stop(nc_));