|
|
|
@ -86,7 +86,6 @@ int main(int argc, char **argv){
|
|
|
|
|
// throw up a background color for invisible glyphs
|
|
|
|
|
uint64_t chan = NCCHANNELS_INITIALIZER(0xff, 0xff, 0xff, 0, 0x80, 0);
|
|
|
|
|
int expy, expx;
|
|
|
|
|
int misses = 0;
|
|
|
|
|
int scrolls = 0;
|
|
|
|
|
while(**argv){
|
|
|
|
|
int sbytes;
|
|
|
|
@ -96,28 +95,23 @@ int main(int argc, char **argv){
|
|
|
|
|
}
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
ncdirect_cursor_yx(n, &newy, &newx);
|
|
|
|
|
if(newy != y){
|
|
|
|
|
if(newy != y + scrolls){
|
|
|
|
|
newx += ncdirect_dim_x(n) * (newy - y);
|
|
|
|
|
}
|
|
|
|
|
ncdirect_cursor_push(n);
|
|
|
|
|
if(x + cols != newx){
|
|
|
|
|
++misses;
|
|
|
|
|
for(i = 0 ; i < misses ; ++i){
|
|
|
|
|
++scrolls;
|
|
|
|
|
for(int k = 0 ; k < scrolls ; ++k){
|
|
|
|
|
putchar('\v');
|
|
|
|
|
}
|
|
|
|
|
printf("True width: %d wcwidth: %d [%.*s]", newx - x, cols, sbytes, *argv);
|
|
|
|
|
int r = printf("True width: %d wcwidth: %d [%.*s]", newx - x, cols, sbytes, *argv);
|
|
|
|
|
ncdirect_cursor_yx(n, &expy, &expx);
|
|
|
|
|
scrolls = (newy + misses) - expy;
|
|
|
|
|
if(scrolls > 1){
|
|
|
|
|
ncdirect_cursor_up(n, scrolls - 1);
|
|
|
|
|
}
|
|
|
|
|
ncdirect_cursor_up(n, scrolls);
|
|
|
|
|
}
|
|
|
|
|
ncdirect_cursor_pop(n);
|
|
|
|
|
*argv += sbytes;
|
|
|
|
|
y = newy - (scrolls - 1);
|
|
|
|
|
y = newy - scrolls;
|
|
|
|
|
x = newx;
|
|
|
|
|
}
|
|
|
|
|
for(i = 0 ; i < misses + 1 ; ++i){
|
|
|
|
|
for(i = 0 ; i < scrolls + 1 ; ++i){
|
|
|
|
|
putchar('\n');
|
|
|
|
|
}
|
|
|
|
|
ncdirect_set_fg_default(n);
|
|
|
|
|