ncpile: add roots element, track from bprev

pull/1190/head
nick black 4 years ago
parent 1b5880c5d9
commit 3b5efb0351
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -303,6 +303,7 @@ typedef struct ncdirect {
typedef struct ncpile {
ncplane* top; // topmost plane, never NULL
ncplane* bottom; // bottommost plane, never NULL
ncplane* roots; // head of root plane list
struct notcurses* nc; // notcurses context
struct ncpile *prev, *next; // circular list
int dimy, dimx; // rows and cols at time of render

@ -304,7 +304,9 @@ make_ncpile(notcurses* nc, ncplane* n){
ret->nc = nc;
ret->top = n;
ret->bottom = n;
if(nc->stdplane){
ret->roots = n;
n->bprev = &ret->roots;
if(nc->stdplane){ // stdplane (and thus stdpile) has already been created
ret->prev = ncplane_pile(nc->stdplane)->prev;
ncplane_pile(nc->stdplane)->prev->next = ret;
ret->next = ncplane_pile(nc->stdplane);

Loading…
Cancel
Save