uniblock: only render at end of a block #41

This commit is contained in:
nick black 2019-11-26 06:25:03 -05:00 committed by Nick Black
parent 762689b276
commit 750518c091
2 changed files with 5 additions and 5 deletions

View File

@ -112,9 +112,9 @@ int unicodeblocks_demo(struct notcurses* nc){
}
}
cell_release(n, &c);
if(notcurses_render(nc)){
return -1;
}
}
if(notcurses_render(nc)){
return -1;
}
usleep(10000);
// for a 32-bit wchar_t, we would want up through 24 bits of block ID. but

View File

@ -576,7 +576,7 @@ int notcurses_render(notcurses* nc){
int y, x;
char* buf = NULL;
size_t buflen = 0;
FILE* out = open_memstream(&buf, &buflen);
FILE* out = open_memstream(&buf, &buflen); // worth keeping around?
if(out == NULL){
return -1;
}
@ -600,7 +600,7 @@ int notcurses_render(notcurses* nc){
}
}
ret |= fclose(out);
printf("%.*s", (int)buflen, buf);
printf("%s", buf);
clock_gettime(CLOCK_MONOTONIC, &done);
free(buf);
update_render_stats(&done, &start, &nc->stats);