]> granicus.if.org Git - neomutt/commitdiff
clean up redraw
authorYubin Ruan <ablacktshirt@gmail.com>
Sun, 1 Apr 2018 04:06:46 +0000 (12:06 +0800)
committerRichard Russon <rich@flatcap.org>
Sun, 1 Apr 2018 04:06:46 +0000 (12:06 +0800)
compose.c: change ->redraw=1 to ->redraw=REDRAW_INDEX

Also modify some lines to make it seem more logical

compose.c

index 95aa06c600ac5e7410da921083b41d12f7e51d47..0ff704c6673cf25f9b9dfbef3ad15f15ee73dbb2 100644 (file)
--- 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: