Skip to content

Commit

Permalink
Ensure window size change
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Mar 2, 2022
1 parent db18863 commit bab505c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions auto-scroll-bar.el
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ and SHOW-H."

(defun auto-scroll-bar--enable ()
"Enable function `auto-scroll-bar-mode'."
(add-hook 'window-size-change-functions #'auto-scroll-bar--change)
(add-hook 'post-command-hook #'auto-scroll-bar--change) ; post command, less buggy
(toggle-scroll-bar 1)
(when auto-scroll-bar-horizontal (toggle-horizontal-scroll-bar 1))
Expand All @@ -154,6 +155,7 @@ and SHOW-H."

(defun auto-scroll-bar--disable ()
"Disable function `auto-scroll-bar-mode'."
(remove-hook 'window-size-change-functions #'auto-scroll-bar--change)
(remove-hook 'post-command-hook #'auto-scroll-bar--change)
(toggle-scroll-bar -1)
(toggle-horizontal-scroll-bar -1))
Expand Down

0 comments on commit bab505c

Please sign in to comment.