]> granicus.if.org Git - neomutt/commitdiff
pager: skip to body for skip-quoted
authorDavid Sterba <dsterba@suse.cz>
Mon, 17 Oct 2016 11:57:34 +0000 (13:57 +0200)
committerRichard Russon <rich@flatcap.org>
Wed, 19 Oct 2016 12:20:12 +0000 (13:20 +0100)
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 <skip-quoted>
command.

Closes: #201
Signed-off-by: David Sterba <dsterba@suse.cz>
doc/manual.xml.head
pager.c

index 892aa70d3ac981f6db84dafe7a9127634b78f6eb..34636d1e47232a9f10feffd242b09252ca82f751 100644 (file)
@@ -13411,7 +13411,7 @@ color sidebar_ordinary color245 default
     <para>
       When viewing an email, the
       <literal>&lt;skip-to-quoted&gt;</literal> function (by default the
-      <literal>S</literal> key) will scroll past any quoted text.
+      <literal>S</literal> key) will scroll past any email headers or quoted text.
       Sometimes, a little context is useful.
     </para>
 
diff --git a/pager.c b/pager.c
index 7bc1fa6f754d18a6da808ce341e029f0844f71a7..ed90991f7ebdd2fd8f6585b49d051269bc807d5d 100644 (file)
--- 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),