ncneofetch: work no matter y offset, done! #750

pull/760/head
nick black 4 years ago committed by Nick Black
parent ef9e50be33
commit 31c584e2e6

@ -273,18 +273,27 @@ drawpalette(struct ncdirect* nc){
static struct notcurses*
place_infoplane(struct ncdirect* ncd, int planeheight){
const int dimy = ncdirect_dim_y(ncd);
int cury;
if(ncdirect_cursor_yx(ncd, &cury, NULL)){
ncdirect_stop(ncd);
return NULL;
}
struct notcurses_options opts = {
.flags = NCOPTION_SUPPRESS_BANNERS | NCOPTION_INHIBIT_SETLOCALE
| NCOPTION_NO_ALTERNATE_SCREEN,
.margin_t = dimy - planeheight,
.margin_t = cury,
.margin_b = dimy - (cury + planeheight),
};
if(ncdirect_stop(ncd)){
return NULL;
}
for(int i = 0 ; i < planeheight ; ++i){
// if we're at the bottom of the screen, we need scroll it up, and adjust
while(opts.margin_b < 0){
if(putchar('\n') == EOF){
return NULL;
}
++opts.margin_b;
--opts.margin_t;
}
if(ncdirect_stop(ncd)){
return NULL;
}
return notcurses_init(&opts, NULL);
}

@ -275,7 +275,7 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np){
// not have it when using 2x1 (we insert blank lines otherwise). don't paper
// over it with a conditional, but instead get to the bottom of this FIXME.
ncdirect_cursor_left(n, dimx);
ncdirect_cursor_down(n, 1);
//ncdirect_cursor_down(n, 1);
}
return 0;
}

Loading…
Cancel
Save