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:
parent
016494d277
commit
d2ae6f7e7a
1 changed files with 4 additions and 1 deletions
|
|
@ -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)))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue