]> git.pld-linux.org Git - packages/mutt.git/blobdiff - mutt-sidebar.patch
- update to 1.5.22
[packages/mutt.git] / mutt-sidebar.patch
index eb73dfcf0b4b9596bc22e3233219e76c0cb78a5a..fe1f1a92d1aac0cea33e11ed1c76100d15ff67c6 100644 (file)
@@ -162,18 +162,18 @@ diff -urN mutt-1.5.21/compose.c mutt-1.5.21-sidebar/compose.c
 -#define W (COLS - HDR_XOFFSET)
 +#define W (COLS - HDR_XOFFSET - SidebarWidth)
  
- static char *Prompts[] =
+ static const char * const Prompts[] =
  {
-@@ -112,7 +112,7 @@
- {
-   int off = 0;
+@@ -110,7 +110,7 @@
  
+ static void redraw_crypt_lines (HEADER *msg)
+ {
 -  mvaddstr (HDR_CRYPT, 0, "Security: ");
 +  mvaddstr (HDR_CRYPT, SidebarWidth, "Security: ");
  
    if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
    {
-@@ -144,7 +144,7 @@
+@@ -142,7 +142,7 @@
    }
  
    clrtoeol ();
@@ -182,16 +182,16 @@ diff -urN mutt-1.5.21/compose.c mutt-1.5.21-sidebar/compose.c
    clrtoeol ();
  
    if ((WithCrypto & APPLICATION_PGP)
-@@ -161,7 +161,7 @@
+@@ -159,7 +159,7 @@
        && (msg->security & ENCRYPT)
        && SmimeCryptAlg
        && *SmimeCryptAlg) {
 -      mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
 +      mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
                NONULL(SmimeCryptAlg));
-       off = 20;
    }
-@@ -175,7 +175,7 @@
+ }
+@@ -172,7 +172,7 @@
    int c;
    char *t;
  
@@ -200,7 +200,7 @@ diff -urN mutt-1.5.21/compose.c mutt-1.5.21-sidebar/compose.c
  
    if (!chain)
    {
-@@ -190,7 +190,7 @@
+@@ -187,7 +187,7 @@
      if (t && t[0] == '0' && t[1] == '\0')
        t = "<random>";
      
@@ -209,7 +209,7 @@ diff -urN mutt-1.5.21/compose.c mutt-1.5.21-sidebar/compose.c
        break;
  
      addstr (NONULL(t));
-@@ -242,7 +242,7 @@
+@@ -239,7 +239,7 @@
  
    buf[0] = 0;
    rfc822_write_address (buf, sizeof (buf), addr, 1);
@@ -218,7 +218,7 @@ diff -urN mutt-1.5.21/compose.c mutt-1.5.21-sidebar/compose.c
    mutt_paddstr (W, buf);
  }
  
-@@ -252,10 +252,10 @@
+@@ -249,10 +249,10 @@
    draw_envelope_addr (HDR_TO, msg->env->to);
    draw_envelope_addr (HDR_CC, msg->env->cc);
    draw_envelope_addr (HDR_BCC, msg->env->bcc);
@@ -231,16 +231,16 @@ diff -urN mutt-1.5.21/compose.c mutt-1.5.21-sidebar/compose.c
    mutt_paddstr (W, fcc);
  
    if (WithCrypto)
-@@ -266,7 +266,7 @@
+@@ -263,7 +263,7 @@
  #endif
  
    SETCOLOR (MT_COLOR_STATUS);
 -  mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));
 +  mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
-   BKGDSET (MT_COLOR_STATUS);
    clrtoeol ();
  
-@@ -304,7 +304,7 @@
+   NORMAL_COLOR;
+@@ -299,7 +299,7 @@
    /* redraw the expanded list so the user can see the result */
    buf[0] = 0;
    rfc822_write_address (buf, sizeof (buf), *addr, 1);
@@ -249,16 +249,16 @@ diff -urN mutt-1.5.21/compose.c mutt-1.5.21-sidebar/compose.c
    mutt_paddstr (W, buf);
    
    return 0;
-@@ -549,7 +549,7 @@
+@@ -544,7 +544,7 @@
        if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
        {
          mutt_str_replace (&msg->env->subject, buf);
 -        move (HDR_SUBJECT, HDR_XOFFSET);
 +        move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
-         clrtoeol ();
          if (msg->env->subject)
            mutt_paddstr (W, msg->env->subject);
-@@ -566,7 +566,7 @@
+         else
+@@ -562,7 +562,7 @@
        {
          strfcpy (fcc, buf, fcclen);
          mutt_pretty_mailbox (fcc, fcclen);
@@ -303,21 +303,20 @@ diff -urN mutt-1.5.21/curs_main.c mutt-1.5.21-sidebar/curs_main.c
        mutt_show_error ();
      }
  
-@@ -554,10 +561,13 @@
+@@ -554,9 +561,12 @@
  
-       if (menu->redraw & REDRAW_STATUS)
+       if ((menu->redraw & REDRAW_STATUS) || update_status_time ())
        {
 +        DrawFullLine = 1;
        menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
 +        DrawFullLine = 0;
-       CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2);
+       move (option (OPTSTATUSONTOP) ? 0 : LINES-2, 0);
        SETCOLOR (MT_COLOR_STATUS);
-         BKGDSET (MT_COLOR_STATUS);
 +        set_buffystats(Context);
        mutt_paddstr (COLS, buf);
-       SETCOLOR (MT_COLOR_NORMAL);
-         BKGDSET (MT_COLOR_NORMAL);
-@@ -571,7 +581,7 @@
+       NORMAL_COLOR;
+       menu->redraw &= ~REDRAW_STATUS;
+@@ -569,7 +579,7 @@
        menu->oldcurrent = -1;
  
        if (option (OPTARROWCURSOR))
@@ -326,7 +325,7 @@ diff -urN mutt-1.5.21/curs_main.c mutt-1.5.21-sidebar/curs_main.c
        else if (option (OPTBRAILLEFRIENDLY))
        move (menu->current - menu->top + menu->offset, 0);
        else
-@@ -1069,6 +1079,7 @@
+@@ -1070,6 +1080,7 @@
          menu->redraw = REDRAW_FULL;
        break;
  
@@ -334,7 +333,7 @@ diff -urN mutt-1.5.21/curs_main.c mutt-1.5.21-sidebar/curs_main.c
        case OP_MAIN_CHANGE_FOLDER:
        case OP_MAIN_NEXT_UNREAD_MAILBOX:
  
-@@ -1100,7 +1111,11 @@
+@@ -1101,7 +1112,11 @@
        {
          mutt_buffy (buf, sizeof (buf));
  
@@ -347,7 +346,7 @@ diff -urN mutt-1.5.21/curs_main.c mutt-1.5.21-sidebar/curs_main.c
          {
            if (menu->menu == MENU_PAGER)
            {
-@@ -1118,6 +1133,7 @@
+@@ -1119,6 +1134,7 @@
        }
  
        mutt_expand_path (buf, sizeof (buf));
@@ -355,7 +354,7 @@ diff -urN mutt-1.5.21/curs_main.c mutt-1.5.21-sidebar/curs_main.c
        if (mx_get_magic (buf) <= 0)
        {
          mutt_error (_("%s is not a mailbox."), buf);
-@@ -2208,6 +2224,12 @@
+@@ -2222,6 +2238,12 @@
        mutt_what_key();
        break;
  
@@ -585,9 +584,9 @@ diff -urN mutt-1.5.21/menu.c mutt-1.5.21-sidebar/menu.c
  #include "mbyte.h"
 +#include "sidebar.h"
  
- #include <string.h>
- #include <stdlib.h>
-@@ -156,7 +157,7 @@
+ extern size_t UngetCount;
+@@ -186,7 +187,7 @@
  {
    char *scratch = safe_strdup (s);
    int shift = option (OPTARROWCURSOR) ? 3 : 0;
@@ -596,84 +595,76 @@ diff -urN mutt-1.5.21/menu.c mutt-1.5.21-sidebar/menu.c
  
    mutt_format_string (s, n, cols, cols, FMT_LEFT, ' ', scratch, mutt_strlen (scratch), 1);
    s[n - 1] = 0;
-@@ -207,6 +208,7 @@
-   char buf[LONG_STRING];
-   int i;
+@@ -239,6 +240,7 @@
+   int do_color;
+   int attr;
  
 +  draw_sidebar(1);
    for (i = menu->top; i < menu->top + menu->pagelen; i++)
    {
      if (i < menu->max)
-@@ -217,7 +219,7 @@
-       if (option (OPTARROWCURSOR))
-       {
-         attrset (menu->color (i));
--      CLEARLINE (i - menu->top + menu->offset);
-+      CLEARLINE_WIN (i - menu->top + menu->offset);
+@@ -249,7 +251,7 @@
+       menu_pad_string (buf, sizeof (buf));
  
-       if (i == menu->current)
-       {
-@@ -246,14 +248,14 @@
-         BKGDSET (MT_COLOR_INDICATOR);
-       }
+       ATTRSET(attr);
+-      move(i - menu->top + menu->offset, 0);
++      move(i - menu->top + menu->offset, SidebarWidth);
+       do_color = 1;
  
--      CLEARLINE (i - menu->top + menu->offset);
-+      CLEARLINE_WIN (i - menu->top + menu->offset);
-       print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
-         SETCOLOR (MT_COLOR_NORMAL);
-         BKGDSET (MT_COLOR_NORMAL);
-       }
-     }
+       if (i == menu->current)
+@@ -272,7 +274,7 @@
      else
--      CLEARLINE (i - menu->top + menu->offset);
-+      CLEARLINE_WIN (i - menu->top + menu->offset);
+     {
+       NORMAL_COLOR;
+-      CLEARLINE(i - menu->top + menu->offset);
++      CLEARLINE_WIN(i - menu->top + menu->offset);
+     }
    }
-   menu->redraw = 0;
- }
-@@ -268,7 +270,7 @@
+   NORMAL_COLOR;
+@@ -289,7 +291,7 @@
      return;
    }
    
 -  move (menu->oldcurrent + menu->offset - menu->top, 0);
 +  move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth);
-   SETCOLOR (MT_COLOR_NORMAL);
-   BKGDSET (MT_COLOR_NORMAL);
+   ATTRSET(menu->color (menu->oldcurrent));
  
-@@ -283,13 +285,13 @@
-       clrtoeol ();
+   if (option (OPTARROWCURSOR))
+@@ -301,13 +303,13 @@
+     {
        menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
        menu_pad_string (buf, sizeof (buf));
 -      move (menu->oldcurrent + menu->offset - menu->top, 3);
 +      move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3);
        print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
-       SETCOLOR (MT_COLOR_NORMAL);
      }
  
      /* now draw it in the new location */
--    move (menu->current + menu->offset - menu->top, 0);
-+    move (menu->current + menu->offset - menu->top, SidebarWidth);
-     attrset (menu->color (menu->current));
-     ADDCOLOR (MT_COLOR_INDICATOR);
-     addstr ("->");
-@@ -310,7 +312,7 @@
-     attrset (menu->color (menu->current));
-     ADDCOLOR (MT_COLOR_INDICATOR);
-     BKGDSET (MT_COLOR_INDICATOR);
--    CLEARLINE (menu->current - menu->top + menu->offset);
-+    CLEARLINE_WIN (menu->current - menu->top + menu->offset);
+     SETCOLOR(MT_COLOR_INDICATOR);
+-    mvaddstr(menu->current + menu->offset - menu->top, 0, "->");
++    mvaddstr(menu->current + menu->offset - menu->top, SidebarWidth, "->");
+   }
+   else
+   {
+@@ -320,7 +322,7 @@
+     menu_make_entry (buf, sizeof (buf), menu, menu->current);
+     menu_pad_string (buf, sizeof (buf));
+     SETCOLOR(MT_COLOR_INDICATOR);
+-    move(menu->current - menu->top + menu->offset, 0);
++    move(menu->current - menu->top + menu->offset, SidebarWidth);
      print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
-     SETCOLOR (MT_COLOR_NORMAL);
-     BKGDSET (MT_COLOR_NORMAL);
-@@ -322,7 +324,7 @@
- {
+   }
+   menu->redraw &= REDRAW_STATUS;
+@@ -332,7 +334,7 @@
    char buf[LONG_STRING];
+   int attr = menu->color (menu->current);
    
 -  move (menu->current + menu->offset - menu->top, 0);
 +  move (menu->current + menu->offset - menu->top, SidebarWidth);
    menu_make_entry (buf, sizeof (buf), menu, menu->current);
    menu_pad_string (buf, sizeof (buf));
  
-@@ -875,7 +877,7 @@
+@@ -872,7 +874,7 @@
      
      
      if (option (OPTARROWCURSOR))
@@ -869,7 +860,7 @@ diff -urN mutt-1.5.21/pager.c mutt-1.5.21-sidebar/pager.c
    /* FIXME: this should come from lineInfo */
    memset(&mbstate, 0, sizeof(mbstate));
  
-@@ -1745,7 +1747,7 @@
+@@ -1809,7 +1811,7 @@
      if ((redraw & REDRAW_BODY) || topline != oldtopline)
      {
        do {
@@ -878,7 +869,7 @@ diff -urN mutt-1.5.21/pager.c mutt-1.5.21-sidebar/pager.c
        curline = oldtopline = topline;
        lines = 0;
        force_redraw = 0;
-@@ -1758,6 +1760,7 @@
+@@ -1822,6 +1824,7 @@
                            &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
            lines++;
          curline++;
@@ -886,25 +877,26 @@ diff -urN mutt-1.5.21/pager.c mutt-1.5.21-sidebar/pager.c
        }
        last_offset = lineInfo[curline].offset;
        } while (force_redraw);
-@@ -1771,6 +1774,7 @@
+@@ -1834,6 +1837,7 @@
          addch ('~');
        addch ('\n');
        lines++;
 +      move(lines + bodyoffset, SidebarWidth);
        }
-       /* We are going to update the pager status bar, so it isn't
-        * necessary to reset to normal color now. */
-@@ -1794,21 +1798,21 @@
+       NORMAL_COLOR;
+@@ -1857,22 +1861,22 @@
+       strfcpy(pager_progress_str, (topline == 0) ? "all" : "end", sizeof(pager_progress_str));
        /* print out the pager status bar */
+-      move (statusoffset, 0);
++      move (statusoffset, SidebarWidth);
        SETCOLOR (MT_COLOR_STATUS);
-       BKGDSET (MT_COLOR_STATUS);
--      CLEARLINE (statusoffset);
-+      CLEARLINE_WIN (statusoffset);
  
        if (IsHeader (extra) || IsMsgAttach (extra))
        {
 -      size_t l1 = COLS * MB_LEN_MAX;
-+      size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
++      size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
        size_t l2 = sizeof (buffer);
        hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
        mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
@@ -918,9 +910,9 @@ diff -urN mutt-1.5.21/pager.c mutt-1.5.21-sidebar/pager.c
 -      mutt_paddstr (COLS, bn);
 +        mutt_paddstr (COLS, IsHeader (extra) || IsMsgAttach (extra) ?  buffer : banner);
        }
-       BKGDSET (MT_COLOR_NORMAL);
-       SETCOLOR (MT_COLOR_NORMAL);
-@@ -1819,18 +1823,25 @@
+       NORMAL_COLOR;
+     }
+@@ -1882,16 +1886,23 @@
        /* redraw the pager_index indicator, because the
         * flags for this message might have changed. */
        menu_redraw_current (index);
@@ -934,11 +926,9 @@ diff -urN mutt-1.5.21/pager.c mutt-1.5.21-sidebar/pager.c
 -      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
 +      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth);
        SETCOLOR (MT_COLOR_STATUS);
-       BKGDSET (MT_COLOR_STATUS);
 -      mutt_paddstr (COLS, buffer);
 +      mutt_paddstr (COLS-SidebarWidth, buffer);
-       SETCOLOR (MT_COLOR_NORMAL);
-       BKGDSET (MT_COLOR_NORMAL);
+       NORMAL_COLOR;
      }
  
 +    /* if we're not using the index, update every time */
@@ -948,7 +938,7 @@ diff -urN mutt-1.5.21/pager.c mutt-1.5.21-sidebar/pager.c
      redraw = 0;
  
      if (option(OPTBRAILLEFRIENDLY)) {
-@@ -2756,6 +2765,13 @@
+@@ -2848,6 +2859,13 @@
        mutt_what_key ();
        break;
  
This page took 0.0455100000000001 seconds and 4 git commands to generate.