summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/window-choose.c9
-rw-r--r--usr.bin/tmux/window-more.c8
2 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/tmux/window-choose.c b/usr.bin/tmux/window-choose.c
index 21c43b27160..81a39a9ccaa 100644
--- a/usr.bin/tmux/window-choose.c
+++ b/usr.bin/tmux/window-choose.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-choose.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */
+/* $OpenBSD: window-choose.c,v 1.2 2009/06/24 23:00:31 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -285,10 +285,12 @@ window_choose_write_line(
struct window_choose_mode_item *item;
struct screen *s = &data->screen;
struct grid_cell gc;
+ int utf8flag;
if (data->callback == NULL)
fatalx("called before callback assigned");
+ utf8flag = options_get_number(&wp->window->options, "utf8");
memcpy(&gc, &grid_default_cell, sizeof gc);
if (data->selected == data->top + py) {
gc.fg = options_get_number(&wp->window->options, "mode-bg");
@@ -299,12 +301,11 @@ window_choose_write_line(
screen_write_cursormove(ctx, 0, py);
if (data->top + py < ARRAY_LENGTH(&data->list)) {
item = &ARRAY_ITEM(&data->list, data->top + py);
- screen_write_puts(
- ctx, &gc, "%.*s", (int) screen_size_x(s), item->name);
+ screen_write_nputs(
+ ctx, screen_size_x(s) - 1, &gc, utf8flag, "%s", item->name);
}
while (s->cx < screen_size_x(s))
screen_write_putc(ctx, &gc, ' ');
-
}
void
diff --git a/usr.bin/tmux/window-more.c b/usr.bin/tmux/window-more.c
index 3f75f278252..998d5c2ce3a 100644
--- a/usr.bin/tmux/window-more.c
+++ b/usr.bin/tmux/window-more.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-more.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */
+/* $OpenBSD: window-more.c,v 1.2 2009/06/24 23:00:31 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -175,7 +175,9 @@ window_more_write_line(
struct grid_cell gc;
char *msg, hdr[32];
size_t size;
+ int utf8flag;
+ utf8flag = options_get_number(&wp->window->options, "utf8");
memcpy(&gc, &grid_default_cell, sizeof gc);
if (py == 0) {
@@ -193,8 +195,8 @@ window_more_write_line(
screen_write_cursormove(ctx, 0, py);
if (data->top + py < ARRAY_LENGTH(&data->list)) {
msg = ARRAY_ITEM(&data->list, data->top + py);
- screen_write_puts(
- ctx, &gc, "%.*s", (int) (screen_size_x(s) - size), msg);
+ screen_write_nputs(
+ ctx, screen_size_x(s) - 1 - size, &gc, utf8flag, "%s", msg);
}
while (s->cx < screen_size_x(s) - size)
screen_write_putc(ctx, &gc, ' ');