From 2c649744b796484524102c42499e272a11bac325 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 26 Oct 2024 21:21:11 -0400 Subject: [PATCH] Move the scrolling code to the scrolling section --- init.el | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/init.el b/init.el index 487f07c..4490c0d 100644 --- a/init.el +++ b/init.el @@ -242,13 +242,6 @@ ;; window. (setq scroll-preserve-screen-position t) -;;; Mouse - -;; Emacs 29 -(when (memq 'context-menu minimal-emacs-ui-features) - (when (and (display-graphic-p) (fboundp 'context-menu-mode)) - (add-hook 'after-init-hook #'context-menu-mode))) - (setq hscroll-margin 2 hscroll-step 1 ;; Emacs spends excessive time recentering the screen when the cursor @@ -261,16 +254,22 @@ ;; significantly off-screen. scroll-conservatively 10 scroll-margin 0 - scroll-preserve-screen-position t ;; Reduce cursor lag by preventing automatic adjustments to ;; `window-vscroll' for unusually long lines. Setting ;; `auto-window-vscroll' it to nil also resolves the issue of random ;; half-screen jumps during scrolling. - auto-window-vscroll nil - ;; Mouse - mouse-wheel-scroll-amount '(1 ((shift) . hscroll)) + auto-window-vscroll nil) + +;;; Mouse Scroll + +(setq mouse-wheel-scroll-amount '(1 ((shift) . hscroll)) mouse-wheel-scroll-amount-horizontal 1) +;; Emacs 29 +(when (memq 'context-menu minimal-emacs-ui-features) + (when (and (display-graphic-p) (fboundp 'context-menu-mode)) + (add-hook 'after-init-hook #'context-menu-mode))) + ;;; Cursor ;; The blinking cursor is distracting and interferes with cursor settings in ;; some minor modes that try to change it buffer-locally (e.g., Treemacs).