version 1.115, 2017/03/06 09:02:36 |
version 1.116, 2017/03/07 13:48:28 |
|
|
{ |
{ |
struct screen *s = ctx->s; |
struct screen *s = ctx->s; |
struct screen_write_collect_item *ci, *tmp; |
struct screen_write_collect_item *ci, *tmp; |
u_int y, cx, cy; |
u_int y, cx, cy, items = 0; |
struct tty_ctx ttyctx; |
struct tty_ctx ttyctx; |
|
size_t written = 0; |
|
|
if (ctx->scrolled != 0) { |
if (ctx->scrolled != 0) { |
log_debug("%s: scrolled %u (region %u-%u)", __func__, |
log_debug("%s: scrolled %u (region %u-%u)", __func__, |
|
|
ttyctx.ptr = ci->data; |
ttyctx.ptr = ci->data; |
ttyctx.num = ci->used; |
ttyctx.num = ci->used; |
tty_write(tty_cmd_cells, &ttyctx); |
tty_write(tty_cmd_cells, &ttyctx); |
ctx->written += ci->used; |
|
|
|
|
items++; |
|
written += ci->used; |
|
|
TAILQ_REMOVE(&ctx->list[y].items, ci, entry); |
TAILQ_REMOVE(&ctx->list[y].items, ci, entry); |
free(ci); |
free(ci); |
} |
} |
} |
} |
s->cx = cx; s->cy = cy; |
s->cx = cx; s->cy = cy; |
|
|
|
log_debug("%s: flushed %u items (%zu bytes)", __func__, items, written); |
|
ctx->written += written; |
} |
} |
|
|
/* Finish and store collected cells. */ |
/* Finish and store collected cells. */ |
|
|
|
|
/* |
/* |
* Don't need to check that the attributes and whatnot are still the |
* Don't need to check that the attributes and whatnot are still the |
* same - input_parse will do a flush when anything that isn't a plain |
* same - input_parse will end the collection when anything that isn't |
* character is encountered. Also nothing should make it here that |
* a plain character is encountered. Also nothing should make it here |
* isn't a single ASCII character. |
* that isn't a single ASCII character. |
*/ |
*/ |
|
|
collect = 1; |
collect = 1; |
|
|
collect = 0; |
collect = 0; |
if (!collect) { |
if (!collect) { |
screen_write_collect_end(ctx); |
screen_write_collect_end(ctx); |
|
screen_write_collect_flush(ctx, 0); |
screen_write_cell(ctx, gc); |
screen_write_cell(ctx, gc); |
return; |
return; |
} |
} |