summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-11-14 08:25:13 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-11-14 08:25:13 +0000
commit0b0601a37d16d432a256d66c0bfbe4d3d70087a0 (patch)
tree19739fdd9ce7c3c2724b3a5e13ea4c1873607682 /usr.bin
parent1bd0c67ec96aa45f3bf68aa41e553e869463e0ef (diff)
Log more of UTF-8 input.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/input.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c
index 5665a14adaa..3a94e3981b3 100644
--- a/usr.bin/tmux/input.c
+++ b/usr.bin/tmux/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.89 2015/11/13 08:09:28 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.90 2015/11/14 08:25:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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(ud, ictx->ch);
- utf8_append(&ictx->utf8data, ictx->ch);
+ log_debug("%s %hhu '%*s' (width %hhu)", __func__, ud->size,
+ (int)ud->size, ud->data, ud->width);
- utf8_copy(&ictx->cell.cell.data, &ictx->utf8data);
+ utf8_copy(&ictx->cell.cell.data, ud);
screen_write_cell(&ictx->ctx, &ictx->cell.cell);
return (0);