From 26e8e467e8e4d3e4f4596b9ce50832735cdc4d50 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 25 May 2020 11:59:50 +0000 Subject: Include title for the width of the menu. --- menu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/menu.c b/menu.c index 7f6933c5..16374115 100644 --- a/menu.c +++ b/menu.c @@ -111,6 +111,7 @@ menu_create(const char *title) menu = xcalloc(1, sizeof *menu); menu->title = xstrdup(title); + menu->width = format_width(title); return (menu); } -- cgit From 4589297e43ad4b385c9110879aab8338d7c45474 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 25 May 2020 12:12:58 +0000 Subject: Do not attempt to divide by zero when working out copy position. --- window-copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/window-copy.c b/window-copy.c index 1efe01d0..b869fc83 100644 --- a/window-copy.c +++ b/window-copy.c @@ -3167,7 +3167,7 @@ window_copy_match_at_cursor(struct window_copy_mode_data *data) */ for (at = start; at <= end; at++) { py = at / sx; - px = at % (py * sx); + px = at - (py * sx); grid_get_cell(gd, px, py, &gc); buf = xrealloc(buf, len + gc.data.size + 1); -- cgit