From 0f9698326a382a207e0cd005b6a0d466806c1071 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Fri, 23 Sep 2016 16:07:36 -0700 Subject: [PATCH] Clear pager position when toggling headers. 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 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pager.c b/pager.c index d7674eb30..20a1db22e 100644 --- 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; } } -- 2.40.0