Replace smooth-scrolling package by a native alternative
My tests show that scroll-conservatively does the job, need your feedback on this. See https://github.com/syl20bnr/spacemacs/issues/6097
This commit is contained in:
parent
46b880668c
commit
e06929ddaf
|
@ -9,6 +9,19 @@
|
||||||
;;
|
;;
|
||||||
;;; License: GPLv3
|
;;; License: GPLv3
|
||||||
|
|
||||||
|
|
||||||
|
;; smooth scrolling
|
||||||
|
|
||||||
|
(defun spacemacs/enable-smooth-scrolling ()
|
||||||
|
"Enable smooth scrolling."
|
||||||
|
(interactive)
|
||||||
|
(setq scroll-conservatively 101))
|
||||||
|
|
||||||
|
(defun spacemacs/disable-smooth-scrolling ()
|
||||||
|
"Enable smooth scrolling."
|
||||||
|
(interactive)
|
||||||
|
(setq scroll-conservatively 0))
|
||||||
|
|
||||||
|
|
||||||
;; neotree
|
;; neotree
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
neotree
|
neotree
|
||||||
popup
|
popup
|
||||||
popwin
|
popwin
|
||||||
smooth-scrolling
|
(smooth-scrolling :location built-in)
|
||||||
spaceline
|
spaceline
|
||||||
(zoom-frm :location local)))
|
(zoom-frm :location local)))
|
||||||
|
|
||||||
|
@ -247,33 +247,15 @@
|
||||||
popwin:special-display-config))))))
|
popwin:special-display-config))))))
|
||||||
|
|
||||||
(defun spacemacs-ui-visual/init-smooth-scrolling ()
|
(defun spacemacs-ui-visual/init-smooth-scrolling ()
|
||||||
(use-package smooth-scrolling
|
(setq scroll-preserve-screen-position t
|
||||||
:init
|
scroll-margin 0
|
||||||
(progn
|
scroll-conservatively (if dotspacemacs-smooth-scrolling 101 0))
|
||||||
(setq smooth-scroll-margin 5)
|
(spacemacs|add-toggle smooth-scrolling
|
||||||
(spacemacs|add-toggle smooth-scrolling
|
:status (= 101 scroll-conservatively)
|
||||||
:status smooth-scrolling-mode
|
:on (spacemacs/enable-smooth-scrolling)
|
||||||
:on (progn
|
:off (spacemacs/disable-smooth-scrolling)
|
||||||
(smooth-scrolling-mode)
|
:documentation "Smooth scrolling."
|
||||||
(enable-smooth-scroll-for-function previous-line)
|
:evil-leader "tv"))
|
||||||
(enable-smooth-scroll-for-function next-line)
|
|
||||||
(enable-smooth-scroll-for-function isearch-repeat))
|
|
||||||
:off (progn
|
|
||||||
(smooth-scrolling-mode -1)
|
|
||||||
(disable-smooth-scroll-for-function previous-line)
|
|
||||||
(disable-smooth-scroll-for-function next-line)
|
|
||||||
(disable-smooth-scroll-for-function isearch-repeat))
|
|
||||||
:documentation "Smooth scrolling."
|
|
||||||
:evil-leader "tv")
|
|
||||||
(when dotspacemacs-smooth-scrolling
|
|
||||||
(spacemacs/toggle-smooth-scrolling-on))
|
|
||||||
;; add hooks here only for emacs built-in packages that are not owned
|
|
||||||
;; by a layer.
|
|
||||||
(defun spacemacs//unset-scroll-margin ()
|
|
||||||
"Set scroll-margin to zero."
|
|
||||||
(setq-local scroll-margin 0))
|
|
||||||
(spacemacs/add-to-hooks 'spacemacs//unset-scroll-margin
|
|
||||||
'(messages-buffer-mode-hook)))))
|
|
||||||
|
|
||||||
(defun spacemacs-ui-visual/init-spaceline ()
|
(defun spacemacs-ui-visual/init-spaceline ()
|
||||||
(use-package spaceline-config
|
(use-package spaceline-config
|
||||||
|
|
Loading…
Reference in a new issue