X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.el;h=c611dcc2cc72ebde11568b3e42f2fa6bb0f70f1c;hp=cd4d9963fb98c44a7b017faaf85391b24b293649;hb=c5085642b8c6495ffea3d5709aa6da14cd1d8688;hpb=c963098e2890922ffcf0991466ba66f724e2dfa4 diff --git a/notmuch.el b/notmuch.el index cd4d9963..c611dcc2 100644 --- a/notmuch.el +++ b/notmuch.el @@ -647,7 +647,13 @@ any effects from previous calls to (condition-case nil (scroll-down nil) ((beginning-of-buffer) nil)) - (goto-char (window-start))) + (goto-char (window-start)) + ; Because count-lines counts invivisible lines, we may have + ; scrolled to far. If so., notice this and fix it up. + (if (< (point) previous) + (progn + (goto-char previous) + (recenter 0)))) (notmuch-show-previous-message)))) (defun notmuch-show-advance-and-archive ()