Skip to content

Commit bab505c

Browse files
committed
Ensure window size change
1 parent db18863 commit bab505c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

auto-scroll-bar.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ and SHOW-H."
145145

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

155156
(defun auto-scroll-bar--disable ()
156157
"Disable function `auto-scroll-bar-mode'."
158+
(remove-hook 'window-size-change-functions #'auto-scroll-bar--change)
157159
(remove-hook 'post-command-hook #'auto-scroll-bar--change)
158160
(toggle-scroll-bar -1)
159161
(toggle-horizontal-scroll-bar -1))

0 commit comments

Comments
 (0)