]> granicus.if.org Git - mutt/commitdiff
Adjust gross hack to return to the same line in the pager after an index
authorBrendan Cully <brendan@kublai.com>
Wed, 7 Sep 2005 05:02:41 +0000 (05:02 +0000)
committerBrendan Cully <brendan@kublai.com>
Wed, 7 Sep 2005 05:02:41 +0000 (05:02 +0000)
operation so that it doesn't shoot past the end of the file if there are
fewer lines on return (eg when weed is set).

pager.c

diff --git a/pager.c b/pager.c
index 8d043244818b634b7a7bbe99ac8a58a22e3066c9..4751a76ae1d6dbd8fbf08b44e28ddf81c266a775 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1789,7 +1789,8 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
     move (statusoffset, COLS-1);
     mutt_refresh ();
 
-    if (IsHeader (extra) && OldHdr == extra->hdr && TopLine != topline)
+    if (IsHeader (extra) && OldHdr == extra->hdr && TopLine != topline
+        && lineInfo[curline].offset < sb.st_size-1)
     {
       if (TopLine - topline > lines)
         topline += lines;