workaround a stupid issue in how decoding is performed in mutt *sigh*
[apps/madmutt.git] / lib-mime / rfc3676.c
index 6559cc4..3caa76f 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <utime.h>
 
 
 #include <utime.h>
 
-#include <lib-ui/curses.h>
+#include <lib-ui/lib-ui.h>
 
 #include "state.h"
 #include "rfc3676.h"
 
 #include "state.h"
 #include "rfc3676.h"
@@ -42,15 +42,12 @@ static void print_flowed_line (char *line, STATE * s, int ql) {
       width = MaxLineLength;
   }
   else {
       width = MaxLineLength;
   }
   else {
-    if (option (OPTMBOXPANE))
-      width = COLS - SidebarWidth - WrapMargin - ql - 1;
-    else
-      width = COLS - WrapMargin - ql - 1;
+    width = getmaxx(main_w) - WrapMargin - ql - 1;
 
     if (!(s->flags & M_REPLYING) && option (OPTSTUFFQUOTED))
       --width;
     if (width < 0)
 
     if (!(s->flags & M_REPLYING) && option (OPTSTUFFQUOTED))
       --width;
     if (width < 0)
-      width = COLS;
+      width = getmaxx(main_w);
   }
 
   if (m_strlen(line) == 0) {
   }
 
   if (m_strlen(line) == 0) {