projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Andreas Krennmair:
[apps/madmutt.git]
/
pager.c
diff --git
a/pager.c
b/pager.c
index
cc852a4
..
9dd0f9c
100644
(file)
--- a/
pager.c
+++ b/
pager.c
@@
-26,6
+26,7
@@
#include "pager.h"
#include "attach.h"
#include "mbyte.h"
#include "pager.h"
#include "attach.h"
#include "mbyte.h"
+#include "sidebar.h"
#include "mx.h"
#include "mx.h"
@@
-1037,7
+1038,7
@@
static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
wchar_t wc;
mbstate_t mbstate;
wchar_t wc;
mbstate_t mbstate;
- int wrap_cols = COLS - WrapMargin;
+ int wrap_cols = COLS - WrapMargin
- SidebarWidth
;
if (wrap_cols <= 0)
wrap_cols = COLS;
if (wrap_cols <= 0)
wrap_cols = COLS;
@@
-1688,7
+1689,7
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
if ((redraw & REDRAW_BODY) || topline != oldtopline)
{
do {
if ((redraw & REDRAW_BODY) || topline != oldtopline)
{
do {
- move (bodyoffset,
0
);
+ move (bodyoffset,
SidebarWidth
);
curline = oldtopline = topline;
lines = 0;
force_redraw = 0;
curline = oldtopline = topline;
lines = 0;
force_redraw = 0;
@@
-1701,6
+1702,7
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
&QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
lines++;
curline++;
&QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
lines++;
curline++;
+ move(lines + bodyoffset, SidebarWidth);
}
last_offset = lineInfo[curline].offset;
} while (force_redraw);
}
last_offset = lineInfo[curline].offset;
} while (force_redraw);
@@
-1714,6
+1716,7
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
addch ('~');
addch ('\n');
lines++;
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. */
}
/* We are going to update the pager status bar, so it isn't
* necessary to reset to normal color now. */
@@
-1726,20
+1729,22
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
/* print out the pager status bar */
SETCOLOR (MT_COLOR_STATUS);
BKGDSET (MT_COLOR_STATUS);
/* print out the pager status bar */
SETCOLOR (MT_COLOR_STATUS);
BKGDSET (MT_COLOR_STATUS);
- CLEARLINE
(statusoffset);
+ CLEARLINE
_WIN
(statusoffset);
if (IsHeader (extra))
{
_mutt_make_string (buffer,
if (IsHeader (extra))
{
_mutt_make_string (buffer,
- COLS-9 < sizeof (buffer) ? COLS-9 : sizeof (buffer),
+ COLS-9-SidebarWidth < sizeof (buffer) ?
+ COLS-9-SidebarWidth : sizeof (buffer),
NONULL (PagerFmt), Context, extra->hdr, M_FORMAT_MAKEPRINT);
}
else if (IsMsgAttach (extra))
{
_mutt_make_string (buffer,
NONULL (PagerFmt), Context, extra->hdr, M_FORMAT_MAKEPRINT);
}
else if (IsMsgAttach (extra))
{
_mutt_make_string (buffer,
- COLS - 9 < sizeof (buffer) ? COLS - 9: sizeof (buffer),
+ COLS - 9 - SidebarWidth < sizeof (buffer) ?
+ COLS - 9 - SidebarWidth : sizeof (buffer),
NONULL (PagerFmt), Context, extra->bdy->hdr, M_FORMAT_MAKEPRINT);
}
NONULL (PagerFmt), Context, extra->bdy->hdr, M_FORMAT_MAKEPRINT);
}
- mutt_paddstr (COLS-10, IsHeader (extra) || IsMsgAttach (extra) ?
+ mutt_paddstr (COLS-10
-SidebarWidth
, IsHeader (extra) || IsMsgAttach (extra) ?
buffer : banner);
addstr (" -- (");
if (last_pos < sb.st_size - 1)
buffer : banner);
addstr (" -- (");
if (last_pos < sb.st_size - 1)
@@
-1755,15
+1760,18
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
/* redraw the pager_index indicator, because the
* flags for this message might have changed. */
menu_redraw_current (index);
/* redraw the pager_index indicator, because the
* flags for this message might have changed. */
menu_redraw_current (index);
-
+ draw_sidebar(MENU_PAGER);
/* print out the index status bar */
menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
/* print out the index status bar */
menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
-
-
move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0
);
+ move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)),
+
SidebarWidth
);
SETCOLOR (MT_COLOR_STATUS);
SETCOLOR (MT_COLOR_STATUS);
- mutt_paddstr (COLS, buffer);
+ mutt_paddstr (COLS
-SidebarWidth
, buffer);
SETCOLOR (MT_COLOR_NORMAL);
}
SETCOLOR (MT_COLOR_NORMAL);
}
+ /* if we're not using the index, update every time */
+ if ( index == 0 )
+ draw_sidebar(MENU_PAGER);
redraw = 0;
redraw = 0;
@@
-2570,6
+2578,11
@@
CHECK_IMAP_ACL(IMAP_ACL_WRITE);
case OP_TAG:
CHECK_MODE(IsHeader (extra));
mutt_set_flag (Context, extra->hdr, M_TAG, !extra->hdr->tagged);
case OP_TAG:
CHECK_MODE(IsHeader (extra));
mutt_set_flag (Context, extra->hdr, M_TAG, !extra->hdr->tagged);
+
+ Context->last_tag = extra->hdr->tagged ? extra->hdr :
+ ((Context->last_tag == extra->hdr && !extra->hdr->tagged)
+ ? NULL : Context->last_tag);
+
redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
{
redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
{
@@
-2699,6
+2712,12
@@
CHECK_IMAP_ACL(IMAP_ACL_DELETE);
redraw = REDRAW_FULL;
break;
redraw = REDRAW_FULL;
break;
+ case OP_SIDEBAR_SCROLL_UP:
+ case OP_SIDEBAR_SCROLL_DOWN:
+ case OP_SIDEBAR_NEXT:
+ case OP_SIDEBAR_PREV:
+ scroll_sidebar(ch, MENU_PAGER);
+ break;
default:
ch = -1;
break;
default:
ch = -1;
break;