summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/scroll-bar.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index fa7e4a6d3ec..3e30e1b5e7d 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -92,7 +92,9 @@ EVENT should be a scroll bar click or drag event."
(save-excursion
(set-buffer (window-buffer window))
(save-excursion
- (goto-char (scroll-bar-scale portion-whole (buffer-size)))
+ (goto-char (+ (point-min)
+ (scroll-bar-scale portion-whole
+ (- (point-max) (point-min)))))
(beginning-of-line)
(set-window-start window (point))))))