File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 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
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 )
You can’t perform that action at this time.
0 commit comments