Log more of UTF-8 input.

pull/210/head
nicm 2015-11-14 08:25:12 +00:00
parent c4893d8efd
commit 908e6bb68f
1 changed files with 15 additions and 6 deletions

21
input.c
View File

@ -1921,9 +1921,12 @@ input_exit_rename(struct input_ctx *ictx)
int
input_utf8_open(struct input_ctx *ictx)
{
log_debug("%s", __func__);
struct utf8_data *ud = &ictx->utf8data;
utf8_open(ud, ictx->ch);
log_debug("%s %hhu", __func__, ud->size);
utf8_open(&ictx->utf8data, ictx->ch);
return (0);
}
@ -1931,9 +1934,12 @@ input_utf8_open(struct input_ctx *ictx)
int
input_utf8_add(struct input_ctx *ictx)
{
struct utf8_data *ud = &ictx->utf8data;
utf8_append(ud, ictx->ch);
log_debug("%s", __func__);
utf8_append(&ictx->utf8data, ictx->ch);
return (0);
}
@ -1941,11 +1947,14 @@ input_utf8_add(struct input_ctx *ictx)
int
input_utf8_close(struct input_ctx *ictx)
{
log_debug("%s", __func__);
struct utf8_data *ud = &ictx->utf8data;
utf8_append(&ictx->utf8data, ictx->ch);
utf8_append(ud, ictx->ch);
utf8_copy(&ictx->cell.cell.data, &ictx->utf8data);
log_debug("%s %hhu '%*s' (width %hhu)", __func__, ud->size,
(int)ud->size, ud->data, ud->width);
utf8_copy(&ictx->cell.cell.data, ud);
screen_write_cell(&ictx->ctx, &ictx->cell.cell);
return (0);