From 65f10e4dc15d4420901739cdaa245edfbd136419 Mon Sep 17 00:00:00 2001 From: Ori Date: Tue, 12 May 2020 12:39:04 -0400 Subject: [PATCH] Trigger scroll animation if point is partially off-screen Addresses #55 for `C-n` at bottom of a window showing part of a line of text. Does not take `scroll-margin` into account. --- Readme.org | 2 ++ sublimity.el | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Readme.org b/Readme.org index 70ab2b9..b2f31d7 100644 --- a/Readme.org +++ b/Readme.org @@ -32,6 +32,8 @@ instead. Thus, to disable horizontal scrolling, set =sublimity-auto-hscroll-mode= but not =auto-hscroll-mode= while =sublimity-mode= is turned on. +=sublimity-scroll= currently requires an unset/zero =scroll-margin=. + ** Customization *** sublimity-scroll (smooth scrolling) diff --git a/sublimity.el b/sublimity.el index 98bc6ef..18d0977 100644 --- a/sublimity.el +++ b/sublimity.el @@ -173,8 +173,7 @@ (when handle-scroll (let (deactivate-mark) ;; do vscroll - (when (or (< (point) (window-start)) - (>= (point) (window-end))) + (when (not (pos-visible-in-window-p)) (recenter)) ;; do hscroll (when (and sublimity-auto-hscroll-mode