diff --git a/lisp/follow.el b/lisp/follow.el index b64f4cb734..327c66d5ff 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -679,6 +679,7 @@ follow-scroll-down (goto-char start) (vertical-motion (- (- (window-height win) (if header-line-format 2 1) + (if tab-line-format 2 1) next-screen-context-lines))) (set-window-start win (point)) (goto-char start) @@ -946,8 +947,10 @@ follow-calc-win-end used." (let* ((win (or win (selected-window))) (edges (window-inside-pixel-edges win)) - (ht (- (nth 3 edges) (nth 1 edges))) - (last-line-pos (posn-point (posn-at-x-y 0 (1- ht) win)))) + (ht (+ (- (nth 3 edges) (nth 1 edges)) + (window-header-line-height win) + (window-tab-line-height win))) + (last-line-pos (posn-point (posn-at-x-y 0 (- ht 1) win)))) (if (pos-visible-in-window-p last-line-pos win) (let ((end (window-end win t))) (list end (pos-visible-in-window-p (point-max) win)))