[defaults] Show scroll bar when using the mouse wheel

Thanks to duianto
This commit is contained in:
syl20bnr 2021-03-24 01:34:26 -04:00 committed by Maximilian Wolff
parent 01a84d9fe8
commit 811001a48c
1 changed files with 17 additions and 0 deletions

View File

@ -1438,6 +1438,23 @@ using a visual block/rectangle selection."
(interactive)
(spacemacs/sort-lines-by-column -1))
;; Show scroll bar when using the mouse wheel
(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.
This can be used to temporarily show the scroll bar when mouse wheel scrolling.
(advice-add 'mwheel-scroll :after #'spacemacs//scroll-bar-show-delayed-hide)
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)
(advice-add 'mwheel-scroll :after #'spacemacs//scroll-bar-show-delayed-hide))
;; BEGIN linum mouse helpers
(defvar spacemacs-linum-mdown-line nil