1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

(scroll-bar-drag-1):

Calculate position relative to the accessible part of the buffer.
This commit is contained in:
Richard M. Stallman 1993-06-05 20:58:47 +00:00
parent 016494d277
commit d2ae6f7e7a

View file

@ -103,7 +103,10 @@ EVENT should be a scroll bar click or drag event."
(portion-whole (nth 2 start-position)))
(save-excursion
(set-buffer (window-buffer window))
(goto-char (scroll-bar-scale portion-whole (buffer-size)))
;; Calculate position relative to the accessible part of the buffer.
(goto-char (+ (point-min)
(scroll-bar-scale portion-whole
(- (point-max) (point-min)))))
(beginning-of-line)
(set-window-start window (point)))))