]> granicus.if.org Git - neomutt/commitdiff
Clear pager position when toggling headers.
authorKevin McCarthy <kevin@8t8.us>
Fri, 23 Sep 2016 23:07:36 +0000 (16:07 -0700)
committerRichard Russon <rich@flatcap.org>
Sun, 2 Oct 2016 14:53:30 +0000 (15:53 +0100)
It doesn't make sense to try to preserve the pager position when
toggling headers: the purpose of toggling headers is to see the
headers in full or weeded state.  So, reset the position back to the
top.

pager.c

diff --git a/pager.c b/pager.c
index 6b863ca840b3f7e1a53618798c3f4bdf7a96df7f..b2e360d11ab30ecb2fe0c46831aa5d135e42e1c7 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -3076,12 +3076,16 @@ search_next:
   {
     if (Context)
       Context->msgnotreadyet = -1;
-    if (rc == -1)
-      OldHdr = NULL;
-    else
+    switch (rc)
     {
-      TopLine = topline;
-      OldHdr = extra->hdr;
+      case -1:
+      case OP_DISPLAY_HEADERS:
+        mutt_clear_pager_position ();
+        break;
+      default:
+        TopLine = topline;
+        OldHdr = extra->hdr;
+        break;
     }
   }