From 1a21d193c4fa51c932129f30f00b5e3dda44b1a4 Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 25 Aug 2020 18:20:14 -0400 Subject: [PATCH] ncreader: kill diagnostics #839 --- src/lib/reader.c | 15 ++------------- src/poc/reader.cpp | 5 ++--- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/lib/reader.c b/src/lib/reader.c index 3cd64e1ad..142b3118f 100644 --- a/src/lib/reader.c +++ b/src/lib/reader.c @@ -82,7 +82,7 @@ int ncreader_move_left(ncreader* n){ int viewx = n->ncp->x; int textx = n->textarea->x; int y = n->ncp->y; -fprintf(stderr, "moving left: tcurs: %dx%d vcurs: %dx%d xproj: %d\n", y, textx, y, viewx, n->xproject); +//fprintf(stderr, "moving left: tcurs: %dx%d vcurs: %dx%d xproj: %d\n", y, textx, y, viewx, n->xproject); if(textx == 0){ // are we on the first column of the textarea? if so, we must also be on // the first column of the viewarea. try to move up. @@ -106,7 +106,7 @@ fprintf(stderr, "moving left: tcurs: %dx%d vcurs: %dx%d xproj: %d\n", y, textx, } ncplane_cursor_move_yx(n->textarea, y, textx); ncplane_cursor_move_yx(n->ncp, y, viewx); -fprintf(stderr, "moved left: tcurs: %dx%d vcurs: %dx%d xproj: %d\n", y, textx, y, viewx, n->xproject); +//fprintf(stderr, "moved left: tcurs: %dx%d vcurs: %dx%d xproj: %d\n", y, textx, y, viewx, n->xproject); return 0; } @@ -181,12 +181,6 @@ int ncreader_write_egc(ncreader* n, const char* egc){ logerror(n->ncp->nc, "Fed illegal UTF-8 [%s]\n", egc); return -1; } - -int viewx = n->ncp->x; -int textx = n->textarea->x; -int y = n->ncp->y; -fprintf(stderr, "putting [%s]: tcurs: %dx%d vcurs: %dx%d xproj: %d\n", egc, y, textx, y, viewx, n->xproject); - if(n->textarea->x >= n->textarea->lenx - cols){ if(n->horscroll){ if(ncplane_resize_simple(n->textarea, n->textarea->leny, n->textarea->lenx + cols)){ @@ -208,11 +202,6 @@ fprintf(stderr, "putting [%s]: tcurs: %dx%d vcurs: %dx%d xproj: %d\n", egc, y, t if(n->ncp->x >= n->ncp->lenx){ n->ncp->x = n->ncp->lenx - 1; } -viewx = n->ncp->x; -textx = n->textarea->x; -y = n->ncp->y; -fprintf(stderr, "put [%s]: tcurs: %dx%d vcurs: %dx%d xproj: %d\n", egc, y, textx, y, viewx, n->xproject); - return 0; } diff --git a/src/poc/reader.cpp b/src/poc/reader.cpp index 5839b9192..feddc99fd 100644 --- a/src/poc/reader.cpp +++ b/src/poc/reader.cpp @@ -34,8 +34,8 @@ auto main(int argc, const char** argv) -> int { std::unique_ptr n = std::make_unique(nc.get_stdplane(&dimy, &dimx)); nc.get_term_dim(&dimy, &dimx); ncreader_options opts{}; - opts.physrows = 2;//dimy / 8; - opts.physcols = 20; //dimx / 2; + opts.physrows = dimy / 8; + opts.physcols = dimx / 2; opts.egc = "░"; opts.flags = horscroll ? NCREADER_OPTION_HORSCROLL : 0; // FIXME c++ is crashing @@ -50,7 +50,6 @@ auto main(int argc, const char** argv) -> int { ncinput ni; nc.render(); while(nc.getc(true, &ni) != (char32_t)-1){ -fprintf(stderr, "ID: %04x %c %lc\n", ni.id, ni.ctrl ? 'C' : 'c', ni.id); if(ni.ctrl && ni.id == 'L'){ notcurses_refresh(nc, NULL, NULL); }else if((ni.ctrl && ni.id == 'D') || ni.id == NCKEY_ENTER){