Skip to content

Commit eb560bb

Browse files
committed
Update Ci
1 parent 2fd8c16 commit eb560bb

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

auto-scroll-bar.el

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
:group 'auto-scroll-bar)
5454

5555
(defcustom auto-scroll-bar-horizontal t
56-
"Set to non-nil to auto show/hide horizontal-scroll-bar."
56+
"Set to non-nil to auto show/hide horizontal scroll-bar."
5757
:type 'boolean
5858
:group 'auto-scroll-bar)
5959

@@ -113,14 +113,20 @@
113113
(cl-incf count)))
114114
break))))
115115

116-
(defun auto-scroll-bar--update (win show-v show-h &optional persistent)
117-
"Update scrollbar WIN, SHOW-V, SHOW-H, PERSISTENT."
118-
;;(set-window-scroll-bars win nil show-v nil show-h persistent)
116+
(defun auto-scroll-bar--toggle-p (win show-v show-h)
117+
"Return non-nil if we should call function `set-window-scroll-bars'.
118+
119+
See function `auto-scroll-bar--update' description for arguments WIN, SHOW-V,
120+
and SHOW-H."
119121
(let* ((bars (window-scroll-bars win))
120122
(shown-v (nth 2 bars))
121123
(shown-h (nth 5 bars)))
122-
(when (or (not (eq shown-v show-v)) (not (eq shown-h show-h)))
123-
(set-window-scroll-bars win nil show-v nil show-h persistent)))
124+
(or (not (eq shown-v show-v)) (not (eq shown-h show-h)))))
125+
126+
(defun auto-scroll-bar--update (win show-v show-h &optional persistent)
127+
"Update scrollbar WIN, SHOW-V, SHOW-H, PERSISTENT."
128+
(when (auto-scroll-bar--toggle-p win show-v show-h)
129+
(set-window-scroll-bars win nil show-v nil show-h persistent))
124130
(save-window-excursion (ignore-errors (enlarge-window 1)))) ; refresh
125131

126132
(defun auto-scroll-bar--show-hide (win)

0 commit comments

Comments
 (0)