1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-23 10:34:07 +00:00

(shrink-window-if-larger-than-buffer):

Don't try to redisplay with the cursor at the end
on its own line--that would force a scroll and spoil things.
This commit is contained in:
Karl Heuer 1999-03-17 04:49:21 +00:00
parent ec241f58e0
commit 2de3834bb5

View 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)))))))))