]> 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)
committerKevin McCarthy <kevin@8t8.us>
Fri, 23 Sep 2016 23:07:36 +0000 (16:07 -0700)
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 d7674eb30cb92cc31cfcf59ca39096e1f7624378..20a1db22e2dc2304eb67dff556c8d4f898b4fa11 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -2867,12 +2867,16 @@ search_next:
   if (IsHeader (extra))
   {
     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;
     }
   }