summaryrefslogtreecommitdiffstats
path: root/window-choose.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-24 23:00:31 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-24 23:00:31 +0000
commit23326e40cfe260bf7a30a99a653d8ec1ca5a625f (patch)
tree524c2c8f9bb71d5ec1b455d71ab2785156e6a779 /window-choose.c
parent3db2433448c4084fc6b46ded52e9d8c8fc377d1c (diff)
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-choose.c')
-rw-r--r--window-choose.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/window-choose.c b/window-choose.c
index 5470a7e8..f199b847 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -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