Commit 2de3834b authored by Karl Heuer's avatar Karl Heuer
Browse files

(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.
parent ec241f58
...@@ -278,6 +278,10 @@ or if the window is the only window of its frame." ...@@ -278,6 +278,10 @@ or if the window is the only window of its frame."
(> (nth 1 edges) (cdr (assq 'menu-bar-lines params))))) (> (nth 1 edges) (cdr (assq 'menu-bar-lines params)))))
(let ((text-height (window-buffer-height window)) (let ((text-height (window-buffer-height window))
(window-height (window-height))) (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)) (when (> window-height (1+ text-height))
(shrink-window (shrink-window
(- window-height (max (1+ text-height) window-min-height))))))))) (- window-height (max (1+ text-height) window-min-height)))))))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment