X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=pager.c;h=941ae3fe1d7d0850222e718aa21cf7285253e7d3;hb=8555b7bbd98c4113ab633c5b555110b029e3215d;hp=50c4cd63ad8da3aeb9dc399d3fa67fcfc47e573f;hpb=bbc4fd52516a8afefbd14c77e34f8389d6f0a6ed;p=apps%2Fmadmutt.git diff --git a/pager.c b/pager.c index 50c4cd6..941ae3f 100644 --- a/pager.c +++ b/pager.c @@ -64,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."); +/* 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 (); \ @@ -1693,6 +1697,18 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) move (statusoffset, COLS - 1); 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 (); @@ -2530,6 +2546,8 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) break; case OP_BUFFY_LIST: + if (option (OPTFORCEBUFFYCHECK)) + buffy_check (1); buffy_list (); redraw |= REDRAW_SIDEBAR; break; @@ -2589,8 +2607,15 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) } fclose (fp); - if (IsHeader (extra)) + if (IsHeader (extra)) { Context->msgnotreadyet = -1; + if (rc == -1) + OldHdr = NULL; + else { + TopLine = topline; + OldHdr = extra->hdr; + } + } cleanup_quote (&QuoteList);