render: don't check tcache->cuf until necessary

pull/1060/head
nick black 4 years ago
parent 60fb4a2351
commit 4c15436de8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -719,12 +719,12 @@ stage_cursor(notcurses* nc, FILE* out, int y, int x){
if(nc->rstate.y == y){ // only need move x if(nc->rstate.y == y){ // only need move x
const int xdiff = x - nc->rstate.x; const int xdiff = x - nc->rstate.x;
if(xdiff > 0){ if(xdiff > 0){
if(nc->tcache.cuf && nc->tcache.cuf1){ if(xdiff == 1 && nc->tcache.cuf1){
if(xdiff == 1){ ret = term_emit("cuf1", tiparm(nc->tcache.cuf1), out, false);
ret = term_emit("cuf1", tiparm(nc->tcache.cuf1), out, false); nc->rstate.x = x;
}else{ return ret;
ret = term_emit("cuf", tiparm(nc->tcache.cuf, xdiff), out, false); }else if(nc->tcache.cuf){
} ret = term_emit("cuf", tiparm(nc->tcache.cuf, xdiff), out, false);
nc->rstate.x = x; nc->rstate.x = x;
return ret; return ret;
} }
@ -733,6 +733,7 @@ stage_cursor(notcurses* nc, FILE* out, int y, int x){
} }
// cub1/cub tend to be destructive in my experiments :/ // cub1/cub tend to be destructive in my experiments :/
} }
// cup is required, no need to check for existence
ret = term_emit("cup", tiparm(nc->tcache.cup, y, x), out, false); ret = term_emit("cup", tiparm(nc->tcache.cup, y, x), out, false);
if(ret == 0){ if(ret == 0){
nc->rstate.x = x; nc->rstate.x = x;

Loading…
Cancel
Save