ncreader: kill diagnostics #839

pull/958/head
nick black 4 years ago
parent a63f70840f
commit 1a21d193c4
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -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;
}

@ -34,8 +34,8 @@ auto main(int argc, const char** argv) -> int {
std::unique_ptr<Plane *> n = std::make_unique<Plane *>(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){

Loading…
Cancel
Save