We don't want large (base64) attachments to be visible by default, nor
do we want transformations to appear too early.
So mark all spacers, the orig-headers, and the orig first part as
visible, and everything else invisible.
This will, for example, stop LineCount from counting too much of it if
it happens to start before final visibility is configured
Signed-off-by: NeilBrown <neil@brown.name>
struct pane *p;
struct email_view *evi;
struct mark *m;
- int n;
+ int n, i;
m = vmark_new(ci->focus, MARK_UNGROUPED, NULL);
if (!m)
alloc(evi, pane);
evi->parts = n;
evi->invis = calloc(n+1, sizeof(char));
- memset(evi->invis, 'v', n);
+ for (i = 0; i < n; i++) {
+ if (is_spacer(i))
+ /* Spacers must be visible */
+ evi->invis[i] = 'v';
+ else if (is_orig(i) && i < 2*3)
+ /* Headers and first part can be visible */
+ evi->invis[i] = 'v';
+ else
+ /* Everything else default to invisible */
+ evi->invis[i] = 'i';
+ }
p = pane_register(ci->focus, 0, &email_view_handle.c, evi);
if (!p) {
free(evi);