]> git.eshelyaron.com Git - emacs.git/commitdiff
(shrink-window-if-larger-than-buffer):
authorKarl Heuer <kwzh@gnu.org>
Wed, 17 Mar 1999 04:49:21 +0000 (04:49 +0000)
committerKarl Heuer <kwzh@gnu.org>
Wed, 17 Mar 1999 04:49:21 +0000 (04:49 +0000)
Don't try to redisplay with the cursor at the end
on its own line--that would force a scroll and spoil things.

lisp/window.el

index cd043e0d47e8e0a0638bfd18fb15966271ff2c42..6010f894791454566e01380f59ea5191518311ed 100644 (file)
@@ -278,6 +278,10 @@ or if the window is the only window of its frame."
                    (> (nth 1 edges) (cdr (assq 'menu-bar-lines params)))))
           (let ((text-height (window-buffer-height window))
                 (window-height (window-height)))
+           ;; Don't try to redisplay with the cursor at the end
+           ;; on its own line--that would force a scroll and spoil things.
+           (when (and (eobp) (bolp))
+             (forward-char -1))
             (when (> window-height (1+ text-height))
               (shrink-window
                (- window-height (max (1+ text-height) window-min-height)))))))))