From 42eb15c8e558bab686688381ef64ed8a30b5a147 Mon Sep 17 00:00:00 2001 From: Yubin Ruan Date: Sun, 1 Apr 2018 12:06:46 +0800 Subject: [PATCH] clean up redraw compose.c: change ->redraw=1 to ->redraw=REDRAW_INDEX Also modify some lines to make it seem more logical --- compose.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compose.c b/compose.c index 95aa06c60..0ff704c66 100644 --- a/compose.c +++ b/compose.c @@ -1146,6 +1146,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, for (int j = i; j < actx->idxlen - 1; j++) { actx->idx[j] = actx->idx[j + 1]; + actx->idx[j + 1] = NULL; /* for debug reason */ } actx->idxlen--; } @@ -1159,15 +1160,15 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, group->next = NULL; mutt_generate_boundary(&group->parameter); - struct AttachPtr *gptr = mutt_mem_calloc(1, sizeof(struct AttachPtr)); - gptr->content = group; - update_idx(menu, actx, gptr); - /* if no group desc yet, make one up */ if (!group->description) group->description = mutt_str_strdup("unknown alternative group"); + + struct AttachPtr *gptr = mutt_mem_calloc(1, sizeof(struct AttachPtr)); + gptr->content = group; + update_idx(menu, actx, gptr); } - menu->redraw = 1; + menu->redraw = REDRAW_INDEX; break; case OP_COMPOSE_ATTACH_FILE: -- 2.40.0