From 23326e40cfe260bf7a30a99a653d8ec1ca5a625f Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 24 Jun 2009 23:00:31 +0000 Subject: 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. --- window-more.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'window-more.c') diff --git a/window-more.c b/window-more.c index b09cc23c..721dac3d 100644 --- a/window-more.c +++ b/window-more.c @@ -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, ' '); -- cgit