Skip to content

Commit

Permalink
feat: Cache window-end
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jul 7, 2024
1 parent 62d0b56 commit dfd2de1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion auto-scroll-bar.el
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ and SHOW-H."
(with-selected-window win
(if (auto-scroll-bar--disabled-p)
(auto-scroll-bar--update win nil nil)
(let* ((wend (window-end nil t))
(let* ((wend (or (window-parameter win 'window-end)
(set-window-parameter win 'window-end
(window-end nil t))))
(wstart (window-start))
(show-v (auto-scroll-bar--show-v-p wstart wend))
(show-h (auto-scroll-bar--show-h-p wstart wend)))
Expand Down Expand Up @@ -180,6 +182,7 @@ Optional argument FRAME is used to select frame's minibuffer."
;; The hook `window-scroll-functions' doesn't get called on horizontal scroll.
(defun auto-scroll-bar--post-command (&rest _)
"Hook for post-command."
(set-window-parameter nil 'window-end nil)
(auto-scroll-bar--scroll (selected-window)))

(defun auto-scroll-bar--enable ()
Expand Down

0 comments on commit dfd2de1

Please sign in to comment.