projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
pager.c
diff --git
a/pager.c
b/pager.c
index
ecb430d
..
25396d7
100644
(file)
--- a/
pager.c
+++ b/
pager.c
@@
-16,6
+16,7
@@
#endif
#include "mutt.h"
#endif
#include "mutt.h"
+#include "enter.h"
#include "mutt_curses.h"
#include "keymap.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "keymap.h"
#include "mutt_menu.h"
@@
-23,6
+24,7
@@
#include "sort.h"
#include "pager.h"
#include "attach.h"
#include "sort.h"
#include "pager.h"
#include "attach.h"
+#include "recvattach.h"
#include "mbyte.h"
#include "sidebar.h"
#include "buffy.h"
#include "mbyte.h"
#include "sidebar.h"
#include "buffy.h"
@@
-62,6
+64,10
@@
static const char *Mailbox_is_read_only = N_("Mailbox is read-only.");
static const char *Function_not_permitted_in_attach_message_mode =
N_("Function not permitted in attach-message mode.");
static const char *Function_not_permitted_in_attach_message_mode =
N_("Function not permitted in attach-message mode.");
+/* hack to return to position when returning from index to same message */
+static int TopLine = 0;
+static HEADER *OldHdr = NULL;
+
#define CHECK_MODE(x) if (!(x)) \
{ \
mutt_flushinp (); \
#define CHECK_MODE(x) if (!(x)) \
{ \
mutt_flushinp (); \
@@
-99,7
+105,7
@@
struct syntax_t {
};
struct line_t {
};
struct line_t {
-
long
offset;
+
LOFF_T
offset;
short type;
short continuation;
short chunks;
short type;
short continuation;
short chunks;
@@
-641,6
+647,9
@@
static struct q_class_t *classify_quote (struct q_class_t **QuoteList,
return class;
}
return class;
}
+static int brailleLine = -1;
+static int brailleCol = -1;
+
static int check_attachment_marker (char *);
static void
static int check_attachment_marker (char *);
static void
@@
-653,8
+662,10
@@
resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last,
int found, offset, null_rx, i;
if (n == 0 || ISHEADER (lineInfo[n - 1].type)) {
int found, offset, null_rx, i;
if (n == 0 || ISHEADER (lineInfo[n - 1].type)) {
- if (buf[0] == '\n')
+ if (buf[0] == '\n')
{
lineInfo[n].type = MT_COLOR_NORMAL;
lineInfo[n].type = MT_COLOR_NORMAL;
+ getyx(stdscr, brailleLine, brailleCol);
+ }
else if (n > 0 && (buf[0] == ' ' || buf[0] == '\t')) {
lineInfo[n].type = lineInfo[n - 1].type; /* wrapped line */
(lineInfo[n].syntax)[0].color = (lineInfo[n - 1].syntax)[0].color;
else if (n > 0 && (buf[0] == ' ' || buf[0] == '\t')) {
lineInfo[n].type = lineInfo[n - 1].type; /* wrapped line */
(lineInfo[n].syntax)[0].color = (lineInfo[n - 1].syntax)[0].color;
@@
-897,7
+908,7
@@
static int trim_incomplete_mbyte(unsigned char *buf, size_t len) {
}
static int
}
static int
-fill_buffer (FILE * f,
long *last_pos, long
offset, unsigned char *buf,
+fill_buffer (FILE * f,
LOFF_T *last_pos, LOFF_T
offset, unsigned char *buf,
unsigned char *fmt, size_t blen, int *buf_ready)
{
unsigned char *p;
unsigned char *fmt, size_t blen, int *buf_ready)
{
unsigned char *p;
@@
-906,12
+917,12
@@
fill_buffer (FILE * f, long *last_pos, long offset, unsigned char *buf,
if (*buf_ready == 0) {
buf[blen - 1] = 0;
if (offset != *last_pos)
if (*buf_ready == 0) {
buf[blen - 1] = 0;
if (offset != *last_pos)
- fseek (f, offset, 0);
+ fseek
o
(f, offset, 0);
if (fgets ((char *) buf, blen - 1, f) == NULL) {
fmt[0] = 0;
return (-1);
}
if (fgets ((char *) buf, blen - 1, f) == NULL) {
fmt[0] = 0;
return (-1);
}
- *last_pos = ftell (f);
+ *last_pos = ftell
o
(f);
b_read = (int) (*last_pos - offset);
*buf_ready = 1;
b_read = (int) (*last_pos - offset);
*buf_ready = 1;
@@
-1119,7
+1130,7
@@
static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
*/
static int
*/
static int
-display_line (FILE * f,
long
*last_pos, struct line_t **lineInfo, int n,
+display_line (FILE * f,
LOFF_T
*last_pos, struct line_t **lineInfo, int n,
int *last, int *max, int flags, struct q_class_t **QuoteList,
int *q_level, int *force_redraw, regex_t * SearchRE)
{
int *last, int *max, int flags, struct q_class_t **QuoteList,
int *q_level, int *force_redraw, regex_t * SearchRE)
{
@@
-1412,7
+1423,7
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
int r = -1;
int redraw = REDRAW_FULL;
FILE *fp = NULL;
int r = -1;
int redraw = REDRAW_FULL;
FILE *fp = NULL;
-
long
last_pos = 0, last_offset = 0;
+
LOFF_T
last_pos = 0, last_offset = 0;
int old_smart_wrap, old_markers;
struct stat sb;
regex_t SearchRE;
int old_smart_wrap, old_markers;
struct stat sb;
regex_t SearchRE;
@@
-1689,8
+1700,26
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
redraw = 0;
redraw = 0;
- move (statusoffset, COLS - 1);
+ if (option(OPTBRAILLEFRIENDLY)) {
+ if (brailleLine!=-1) {
+ move(brailleLine+1, 0);
+ brailleLine = -1;
+ }
+ } else
+ move (statusoffset, COLS-1);
mutt_refresh ();
mutt_refresh ();
+
+ if (IsHeader (extra) && OldHdr == extra->hdr && TopLine != topline
+ && lineInfo[curline].offset < sb.st_size-1) {
+ if (TopLine - topline > lines)
+ topline += lines;
+ else
+ topline = TopLine;
+ continue;
+ }
+ else
+ OldHdr = NULL;
+
ch = km_dokey (MENU_PAGER);
if (ch != -1)
mutt_clear_error ();
ch = km_dokey (MENU_PAGER);
if (ch != -1)
mutt_clear_error ();
@@
-2528,6
+2557,8
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
break;
case OP_BUFFY_LIST:
break;
case OP_BUFFY_LIST:
+ if (option (OPTFORCEBUFFYCHECK))
+ buffy_check (1);
buffy_list ();
redraw |= REDRAW_SIDEBAR;
break;
buffy_list ();
redraw |= REDRAW_SIDEBAR;
break;
@@
-2587,8
+2618,15
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
}
fclose (fp);
}
fclose (fp);
- if (IsHeader (extra))
+ if (IsHeader (extra))
{
Context->msgnotreadyet = -1;
Context->msgnotreadyet = -1;
+ if (rc == -1)
+ OldHdr = NULL;
+ else {
+ TopLine = topline;
+ OldHdr = extra->hdr;
+ }
+ }
cleanup_quote (&QuoteList);
cleanup_quote (&QuoteList);