From: David Sterba Date: Mon, 17 Oct 2016 11:57:34 +0000 (+0200) Subject: pager: skip to body for skip-quoted X-Git-Tag: neomutt-20161028~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4153f3e9a98e9edbe0548dcdaee42adf6579402;p=neomutt pager: skip to body for skip-quoted In mails with many headers that fill the whole screen, it's convenient to jump to the body, implemented as a side-efect of the command. Closes: #201 Signed-off-by: David Sterba --- diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 892aa70d3..34636d1e4 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -13411,7 +13411,7 @@ color sidebar_ordinary color245 default When viewing an email, the <skip-to-quoted> function (by default the - S key) will scroll past any quoted text. + S key) will scroll past any email headers or quoted text. Sometimes, a little context is useful. diff --git a/pager.c b/pager.c index 7bc1fa6f7..ed90991f7 100644 --- a/pager.c +++ b/pager.c @@ -2439,6 +2439,21 @@ search_next: int dretval = 0; int new_topline = topline; + /* Skip all the email headers */ + if (ISHEADER(lineInfo[new_topline].type)) + { + while ((new_topline < lastLine || + (0 == (dretval = display_line (fp, &last_pos, &lineInfo, + new_topline, &lastLine, &maxLine, MUTT_TYPES | (flags & MUTT_PAGER_NOWRAP), + &QuoteList, &q_level, &force_redraw, &SearchRE, pager_window)))) + && ISHEADER(lineInfo[new_topline].type)) + { + new_topline++; + } + topline = new_topline; + break; + } + while (((new_topline + SkipQuotedOffset) < lastLine || (0 == (dretval = display_line (fp, &last_pos, &lineInfo, new_topline, &lastLine, &maxLine, MUTT_TYPES | (flags & MUTT_PAGER_NOWRAP),