diff --git a/config.el b/config.el index 2e3cdfd..55ab3a9 100644 --- a/config.el +++ b/config.el @@ -37,10 +37,10 @@ ;; (NOT "Follow keyboard focus" — that causes viewport jumping) (use-package! centered-cursor-mode :config - (setq ccm-vpos-init 0.5 ; cursor uprostřed obrazovky - ccm-step-size 2 ; plynulejší scroll + (setq ccm-vpos-init 0.5 ; cursor centered on screen + ccm-step-size 2 ; smoother scrolling ccm-recenter-at-end-of-file t) - ;; Vypnout v terminálu a speciálních módech + ;; Disable in terminal and special modes (define-globalized-minor-mode my/global-ccm centered-cursor-mode (lambda () @@ -768,7 +768,11 @@ Keeps the status bar and tab bar fully visible at any zoom level.") (when (fboundp 'corfu--popup-hide) (ignore-errors (corfu--popup-hide))) (message "Zoom %+d ×%.2f ≈%dpt" - steps (expt 1.5 steps) (/ new-h 10)))) + steps (expt 1.5 steps) (/ new-h 10)) + ;; Ensure cursor stays visible after zoom change. + (when (and (not (minibufferp)) (window-live-p (selected-window))) + (scroll-right (window-hscroll)) ; reset horizontal scroll + (recenter nil)))) ;; Capture base height once Doom finishes font setup. (add-hook 'doom-after-init-hook @@ -813,6 +817,11 @@ Keeps the status bar and tab bar fully visible at any zoom level.") (setq my/zoom-steps my/zoom-saved-steps my/zoom-saved-steps nil))) +;; Keep cursor visible while scrolling at any zoom level. +(setq hscroll-margin 3 + hscroll-step 1 + scroll-conservatively 101 + scroll-margin 2) ;;; ============================================================