Fix and optimize view scrolling by setting scrolling regions

This commit is contained in:
John Lorentzson 2025-07-18 21:19:37 +02:00
parent 34f705aef8
commit 121195a1ad

View file

@ -527,23 +527,27 @@ Additionally ensures correct line numbers on the way, as a bonus."
(update-buffer-cursor (buffer view))))
(defmethod scroll-view-down ((view buffer-view))
(set-scrolling-region 1 (height view))
(scroll-screen-up 1) ; view goes down, screen contents go up
(set-scrolling-region)
(update-view-bottom view)
(setf (top-line view) (next-line (top-line view))
(bottom-line view) (next-line (bottom-line view)))
(unless (null (bottom-line view))
(redisplay-view-from-line view (bottom-line view)))
(redisplay-status-line :completely-p t))
(redisplay-status-line :completely-p nil))
(defmethod scroll-view-up ((view buffer-view))
(set-scrolling-region 1 (height view))
(scroll-screen-down 1) ; view goes up, screen contents go down
(set-scrolling-region)
(update-view-bottom view)
(setf (top-line view)
(prev-line (top-line view))
(bottom-line view)
(prev-line (bottom-line view)))
(redisplay-line (top-line view))
(redisplay-status-line :completely-p t))
(redisplay-status-line :completely-p nil))
(defmethod get-line-into-view ((line line) (view buffer-view))
;; Assuming it's not already.