[defaults] Add dotspacemacs-scroll-bar-while-scrolling

This commit is contained in:
duianto 2021-03-26 15:16:24 +01:00 committed by Maximilian Wolff
parent 811001a48c
commit 4dc1d7640a
4 changed files with 20 additions and 2 deletions

View File

@ -502,6 +502,7 @@ In org-agenda-mode
performance in emacs 27 (thanks to Maximilian Wolff)
- New variable =dotspacemacs-show-trailing-whitespace= (thanks to duianto)
- New var =dotspacemacs-startup-buffer-multi-digit-delay= (thanks to duianto)
- New variable =dotspacemacs-scroll-bar-while-scrolling= (thanks to duianto)
- Removed Variables:
- Removed unused variable =dotspacemacs-verbose-loading= from
=.spacemacs.template= (thanks to Ying Qu)

View File

@ -500,6 +500,12 @@ screen."
'boolean
'spacemacs-dotspacemacs-init)
(spacemacs|defc dotspacemacs-scroll-bar-while-scrolling t
"Show the scroll bar while scrolling. The auto hide time can be configured by
setting this variable to a number."
'(choice boolean number)
'spacemacs-dotspacemacs-init)
(spacemacs|defc dotspacemacs-line-numbers nil
"Control line numbers activation.
If set to `t' or `relative' line numbers are turned on in all `prog-mode' and

View File

@ -374,6 +374,10 @@ It should only modify the values of Spacemacs settings."
;; when it reaches the top or bottom of the screen. (default t)
dotspacemacs-smooth-scrolling t
;; Show the scroll bar while scrolling. The auto hide time can be configured
;; by setting this variable to a number. (default t)
dotspacemacs-scroll-bar-while-scrolling t
;; Control line numbers activation.
;; If set to `t', `relative' or `visual' then line numbers are enabled in all
;; `prog-mode' and `text-mode' derivatives. If set to `relative', line

View File

@ -1442,6 +1442,7 @@ using a visual block/rectangle selection."
(defun spacemacs//scroll-bar-hide ()
" Hide the scroll bar."
(scroll-bar-mode -1))
(defun spacemacs//scroll-bar-show-delayed-hide (&rest _ignore)
"Show the scroll bar for a couple of seconds, before hiding it.
@ -1451,8 +1452,14 @@ This can be used to temporarily show the scroll bar when mouse wheel scrolling.
The advice can be removed with:
(advice-remove 'mwheel-scroll #'spacemacs//scroll-bar-show-delayed-hide)"
(scroll-bar-mode 1)
(run-with-idle-timer 3 nil #'spacemacs//scroll-bar-hide))
(when (fboundp 'scroll-bar-mode)
(run-with-idle-timer
(if (numberp dotspacemacs-scroll-bar-while-scrolling)
dotspacemacs-scroll-bar-while-scrolling
3)
nil
#'spacemacs//scroll-bar-hide))
(when (and (fboundp 'scroll-bar-mode)
dotspacemacs-scroll-bar-while-scrolling)
(advice-add 'mwheel-scroll :after #'spacemacs//scroll-bar-show-delayed-hide))
;; BEGIN linum mouse helpers