Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 20 Feb 2006 15:28:02 +0000 (15:28 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 20 Feb 2006 15:28:02 +0000 (15:28 +0000)
- dirty fix compose screen's attachment where lines are too long (due to mutt_FormatString() ignoring sidebar) (reported by Michael Kjorling <michael@kjorling.com>)

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@784 e385b8ad-14ed-0310-8656-cc95a2468c6d

VERSION.svn
compose.c

index 634a083..3aedf24 100644 (file)
@@ -1 +1 @@
-783
+784
index bb977da..2a701db 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -133,9 +133,27 @@ static struct mapping_t ComposeNewsHelp[] = {
 
 static void snd_entry (char *b, size_t blen, MUTTMENU * menu, int num)
 {
 
 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,
                      (unsigned long) (((ATTACHPTR **) menu->data)[num]),
                      M_FORMAT_STAT_FILE | M_FORMAT_ARROWCURSOR);
   mutt_FormatString (b, blen, 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);
 }
 
 
 }