return class;
}
-static int brailleCol = -1;
-
static int check_attachment_marker (char *);
static void
return (int)(*p - *q);
}
-static int grok_ansi (unsigned char *buf, int pos, ansi_attr * a)
-{
- int x = pos;
-
- while (isdigit (buf[x]) || buf[x] == ';')
- x++;
-
- /* Character Attributes */
- if (option (OPTALLOWANSI) && a != NULL && buf[x] == 'm') {
- if (pos == x) {
- if (a->pair != -1)
- mutt_free_color (a->fg, a->bg);
- a->attr = ANSI_OFF;
- a->pair = -1;
- }
- a->bg = -2;
- a->fg = -2;
- while (pos < x) {
- if (buf[pos] == '1' && (pos + 1 == x || buf[pos + 1] == ';')) {
- a->attr |= ANSI_BOLD;
- pos += 2;
- }
- else if (buf[pos] == '4' && (pos + 1 == x || buf[pos + 1] == ';')) {
- a->attr |= ANSI_UNDERLINE;
- pos += 2;
- }
- else if (buf[pos] == '5' && (pos + 1 == x || buf[pos + 1] == ';')) {
- a->attr |= ANSI_BLINK;
- pos += 2;
- }
- else if (buf[pos] == '7' && (pos + 1 == x || buf[pos + 1] == ';')) {
- a->attr |= ANSI_REVERSE;
- pos += 2;
- }
- else if (buf[pos] == '0' && (pos + 1 == x || buf[pos + 1] == ';')) {
- a->bg = -2;
- a->fg = -2;
- pos += 2;
- }
- else if (buf[pos] == '3' && isdigit (buf[pos + 1])) {
- if (a->pair != -1)
- mutt_free_color (a->fg, a->bg);
- a->pair = -1;
- a->attr |= ANSI_COLOR;
- if (buf[pos + 1] != '9')
- a->fg = buf[pos + 1] - '0';
- pos += 3;
- }
- else if (buf[pos] == '4' && isdigit (buf[pos + 1])) {
- if (a->pair != -1)
- mutt_free_color (a->fg, a->bg);
- a->pair = -1;
- a->attr |= ANSI_COLOR;
- if (buf[pos + 1] != '9')
- a->bg = buf[pos + 1] - '0';
- pos += 3;
- } else {
- while (pos < x && buf[pos] != ';')
- pos++;
- pos++;
- }
- }
- }
- pos = x;
- return pos;
-}
-
/* trim tail of buf so that it contains complete multibyte characters */
static int trim_incomplete_mbyte(unsigned char *buf, size_t len) {
mbstate_t mbstate;
for (ch = 0, vch = 0; ch < cnt; ch += k, vch += k) {
/* Handle ANSI sequences */
while (cnt - ch >= 2 && buf[ch] == '\033' && buf[ch + 1] == '[' &&
- is_ansi (buf + ch + 2))
- ch = grok_ansi (buf, ch + 2, pa) + 1;
+ is_ansi (buf + ch + 2)) {
+ while (isdigit(buf[ch]) || buf[ch] == ';')
+ ch++;
+ }
while (cnt - ch >= 2 && buf[ch] == '\033' && buf[ch + 1] == ']' &&
check_attachment_marker ((char *) buf + ch) == 0) {
int bodylen = LINES - 2 - bodyoffset; /* length of displayable area */
MUTTMENU *pager_index = NULL; /* the Pager Index (PI) */
- int indexoffset = 0; /* offset for the PI */
- int indexlen = PagerIndexLines; /* indexlen not always == PIL */
+ int indexlen = PagerIndexLines; /* indexlen not always == PIL */
int indicator = indexlen / 3; /* the indicator line of the PI */
int old_PagerIndexLines; /* some people want to resize it
* while inside the pager... */
indicator = indexlen / 3;
- if (option (OPTSTATUSONTOP)) {
- indexoffset = 0;
- statusoffset = IsHeader (extra) ? indexlen : 0;
- bodyoffset = statusoffset + 1;
- helpoffset = LINES - 2;
- bodylen = helpoffset - bodyoffset;
- } else {
- helpoffset = 0;
- indexoffset = 1;
- statusoffset = LINES - 2;
- bodyoffset = indexoffset + (IsHeader (extra) ? indexlen : 0);
- bodylen = statusoffset - bodyoffset;
- }
+ statusoffset = IsHeader (extra) ? indexlen : 0;
+ bodyoffset = statusoffset + 1;
+ helpoffset = LINES - 2;
+ bodylen = helpoffset - bodyoffset;
SETCOLOR(main_w, MT_COLOR_STATUS);
wmove(main_w, helpoffset, 0);
}
SETCOLOR(main_w, MT_COLOR_NORMAL);
- pager_index->offset = indexoffset + (option (OPTSTATUSONTOP) ? 1 : 0);
-
+ pager_index->offset = 1;
pager_index->pagelen = indexlen - 1;
/* some fudge to work out where abouts the indicator should go */
sidebar_draw ();
/* print out the pager_index status bar */
menu_status_line (buffer, sizeof (buffer), pager_index, NONULL (Status));
- wmove(main_w, indexoffset + (option(OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
+ wmove(main_w, 0, 0);
SETCOLOR(main_w, MT_COLOR_STATUS);
BKGDSET(main_w, MT_COLOR_STATUS);
mutt_paddstr(main_w, getmaxx(main_w), buffer);