From f6abcc92b23132dd1ee4f10c350b7c84a89c186b Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 8 Dec 2021 00:20:18 -0500 Subject: [PATCH] [ncman] use autogrow --- src/lib/notcurses.c | 9 ++++++--- src/man/main.c | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 630ee43fc..a44928cc2 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1739,11 +1739,14 @@ ncplane_put(ncplane* n, int y, int x, const char* egc, int cols, // predicated on a non-negative x). if(x == -1){ if(n->x + cols - 1 >= n->lenx){ - if(!n->scrolling){ + if(n->scrolling){ + scroll_down(n); + }else if(n->autogrow){ + // FIXME groooooow to the right + }else{ logerror("target x %d [%.*s] > length %d\n", n->x, bytes, egc, n->lenx); return -1; } - scroll_down(n); } } }else{ @@ -1752,7 +1755,7 @@ ncplane_put(ncplane* n, int y, int x, const char* egc, int cols, return -1; } } - // explicit targets outside the plane will be rejected here. + // targets outside the plane will be rejected here. if(ncplane_cursor_move_yx(n, y, x)){ return -1; } diff --git a/src/man/main.c b/src/man/main.c index a20d26f4c..949b461ba 100644 --- a/src/man/main.c +++ b/src/man/main.c @@ -683,6 +683,7 @@ render_troff(struct notcurses* nc, const unsigned char* map, size_t mlen, .cols = dimx, .userptr = dom, .resizecb = resize_pman, + .flags = NCPLANE_OPTION_AUTOGROW | NCPLANE_OPTION_VSCROLL, }; struct ncplane* pman = ncplane_create(stdn, &popts); if(pman == NULL){