X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=compose.c;h=e7d2886cd016d9f9a7b32d2bcc33b423fd8c3327;hp=2a701db88a36324d03e9a9983af98d0b75b706e3;hb=ef7b80006ebb47372d69c64e8b2b2f0764333d55;hpb=198f6eea2ecd25012a1b426027eac13c0d72aaea diff --git a/compose.c b/compose.c index 2a701db..e7d2886 100644 --- a/compose.c +++ b/compose.c @@ -90,7 +90,7 @@ enum { #define SW (option(OPTMBOXPANE)?SidebarWidth:0) #define W (COLS - HDR_XOFFSET - SW) -static char *Prompts[] = { +static const char *Prompts[] = { "From: ", "To: ", "Cc: ", @@ -115,7 +115,7 @@ static struct mapping_t ComposeHelp[] = { {N_("Attach file"), OP_COMPOSE_ATTACH_FILE}, {N_("Descrip"), OP_COMPOSE_EDIT_DESCRIPTION}, {N_("Help"), OP_HELP}, - {NULL} + {NULL, OP_NULL} }; #ifdef USE_NNTP @@ -127,37 +127,17 @@ static struct mapping_t ComposeNewsHelp[] = { {N_("Attach file"), OP_COMPOSE_ATTACH_FILE}, {N_("Descrip"), OP_COMPOSE_EDIT_DESCRIPTION}, {N_("Help"), OP_HELP}, - {NULL} + {NULL, OP_NULL} }; #endif -static void snd_entry (char *b, size_t blen, MUTTMENU * menu, int num) -{ - int old1=DrawFullLine,old2=option(OPTSTATUSONTOP); - - /* - * XXX - * mutt_FormatString is totally broken as it tries to determine - * the max. width of the output string itself which may fail - * (for example, for $status_on_top, many of the format strings - * are as wide as screen but $attach_format is not, etc.) - * - * When $status_on_top is unset, mutt_FormatString() will respect - * sidebar so unset it for compose menu entries by force... ;-( - */ - DrawFullLine=0; - unset_option(OPTSTATUSONTOP); - - mutt_FormatString (b, blen, NONULL (AttachFormat), mutt_attach_fmt, +static void snd_entry (char *b, size_t blen, MUTTMENU * menu, int num) { + int w=(COLS-SW)>blen?blen:COLS-SW; + mutt_FormatString (b, w, NONULL (AttachFormat), mutt_attach_fmt, (unsigned long) (((ATTACHPTR **) menu->data)[num]), M_FORMAT_STAT_FILE | M_FORMAT_ARROWCURSOR); - - DrawFullLine=old1; - if (old2) set_option(OPTSTATUSONTOP); } - - #include "mutt_crypt.h" static void redraw_crypt_lines (HEADER * msg) @@ -227,7 +207,7 @@ static void redraw_crypt_lines (HEADER * msg) static void redraw_mix_line (LIST * chain) { int c; - char *t; + const char *t; mvaddstr (HDR_MIX, SW, " Mix: "); @@ -521,7 +501,8 @@ static const char *compose_format_str (char *buf, size_t buflen, char op, static void compose_status_line (char *buf, size_t buflen, MUTTMENU * menu, const char *p) { - mutt_FormatString (buf, buflen, p, compose_format_str, + int w=(COLS-SW)>buflen?buflen:(COLS-SW); + mutt_FormatString (buf, w, p, compose_format_str, (unsigned long) menu, 0); } @@ -583,7 +564,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ ComposeHelp); if (option (OPTMBOXPANE)) - buffy_check (1); + buffy_check (0); while (loop) { #ifdef USE_NNTP unset_option (OPTNEWS); /* for any case */ @@ -1426,7 +1407,8 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ compose_status_line (buf, sizeof (buf), menu, NONULL (ComposeFormat)); CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES - 2); SETCOLOR (MT_COLOR_STATUS); - printw ("%-*.*s", COLS, COLS, buf); + move (option (OPTSTATUSONTOP) ? 0 : LINES - 2, SW); + printw ("%-*.*s", COLS-SW, COLS-SW, buf); SETCOLOR (MT_COLOR_NORMAL); menu->redraw &= ~REDRAW_STATUS; }