From 0c484e4e0285516e96e470f653ee43818f0f57d4 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 9 Jul 2021 04:27:38 -0400 Subject: [PATCH] run the logend{yx} state machine in raster #1906 --- src/lib/render.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib/render.c b/src/lib/render.c index bb4624b2d..89ad50979 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -748,6 +748,12 @@ goto_location(notcurses* nc, FILE* out, int y, int x){ } nc->rstate.x = x; nc->rstate.y = y; + if(nc->rstate.logendy >= 0){ + if(y > nc->rstate.logendy || (y == nc->rstate.logendy && x > nc->rstate.logendx)){ + nc->rstate.logendy = y; + nc->rstate.logendx = x; + } + } return ret; } @@ -905,6 +911,13 @@ clean_sprixels(notcurses* nc, ncpile* p, FILE* out){ static int rasterize_scrolls(ncpile* p, FILE* out){ //fprintf(stderr, "%d tardies to work off, by far the most in the class\n", p->scrolls); + if(p->nc->rstate.logendy >= 0){ + p->nc->rstate.logendy -= p->scrolls; + if(p->nc->rstate.logendy < 0){ + p->nc->rstate.logendy = 0; + p->nc->rstate.logendx = 0; + } + } while(p->scrolls){ if(ncfputc('\v', out) < 0){ return -1;