aboutsummaryrefslogtreecommitdiff
path: root/window-more.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 16:05:00 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 16:05:00 +0000
commita03ae97fbf63acaacdc1353eadbd225dd4e03b7b (patch)
tree7a25b64345d8960796b17f4e4c117fa8785d4ab5 /window-more.c
parent3ec8efc803e3fd8c60e7cc7af038d65fe859884b (diff)
downloadrtmux-a03ae97fbf63acaacdc1353eadbd225dd4e03b7b.tar.gz
rtmux-a03ae97fbf63acaacdc1353eadbd225dd4e03b7b.tar.bz2
rtmux-a03ae97fbf63acaacdc1353eadbd225dd4e03b7b.zip
Now that a UTF-8-capable puts function exists, use it for printing strings in
choice/more modes - lines with UTF-8 now display properly in find-window results.
Diffstat (limited to 'window-more.c')
-rw-r--r--window-more.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/window-more.c b/window-more.c
index 97009a81..998d5c2c 100644
--- a/window-more.c
+++ b/window-more.c
@@ -1,4 +1,4 @@
-/* $Id: window-more.c,v 1.29 2009-02-13 21:39:45 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, ' ');