[cli PoC] set scrolling on stdn #2196

This commit is contained in:
nick black 2021-11-24 13:21:16 -05:00 committed by nick black
parent 508e143916
commit 717aaf9d5d
2 changed files with 14 additions and 5 deletions

View File

@ -1252,9 +1252,7 @@ rasterize_core(notcurses* nc, const ncpile* p, fbuf* f, unsigned phase){
//fprintf(stderr, "damageidx: %ld\n", damageidx);
}
if(saw_linefeed){
fprintf(stderr, "OH WE SAW THE LINEFEED (%d/%d)!\n", nc->rstate.logendy, nc->rstate.logendx);
nc->rstate.logendx = 0;
fprintf(stderr, "OH WE SAW THE LINEFEED (%d/%d)!\n", nc->rstate.logendy, nc->rstate.logendx);
}
}
return 0;

View File

@ -11,13 +11,24 @@ int main(void){
return EXIT_FAILURE;
}
struct ncplane* stdn = notcurses_stdplane(nc);
ncplane_putstr(stdn, "press any key\n");
notcurses_render(nc);
ncplane_set_scrolling(stdn, true);
if(ncplane_putstr(stdn, "press any key\n") < 0){
goto err;
}
if(notcurses_render(nc)){
goto err;
}
ncinput ni;
do{
notcurses_get_blocking(nc, &ni);
}while(ni.evtype == NCTYPE_RELEASE);
notcurses_render(nc);
if(notcurses_render(nc)){
goto err;
}
notcurses_stop(nc);
return EXIT_SUCCESS;
err:
notcurses_stop(nc);
return EXIT_FAILURE;
}