Skip to content

Commit

Permalink
Don't enable when in terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 18, 2022
1 parent 75d01ad commit 8bda044
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions auto-scroll-bar.el
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@ and SHOW-H."

(defun auto-scroll-bar--enable ()
"Enable function `auto-scroll-bar-mode'."
(add-hook 'window-size-change-functions #'auto-scroll-bar--size-change)
(add-hook 'window-scroll-functions #'auto-scroll-bar--scroll)
(toggle-scroll-bar 1)
(when auto-scroll-bar-horizontal (toggle-horizontal-scroll-bar 1))
(auto-scroll-bar--size-change)) ; execute once
(cond ((display-graphic-p)
(add-hook 'window-size-change-functions #'auto-scroll-bar--size-change)
(add-hook 'window-scroll-functions #'auto-scroll-bar--scroll)
(toggle-scroll-bar 1)
(when auto-scroll-bar-horizontal (toggle-horizontal-scroll-bar 1))
(auto-scroll-bar--size-change)) ; execute once
(t (auto-scroll-bar-mode -1))))

(defun auto-scroll-bar--disable ()
"Disable function `auto-scroll-bar-mode'."
Expand Down

0 comments on commit 8bda044

Please sign in to comment.