Skip to content

Commit

Permalink
Trigger scroll animation if point is partially off-screen
Browse files Browse the repository at this point in the history
Addresses zk-phi#55 for `C-n` at bottom of a window showing part of a line
of text. Does not take `scroll-margin` into account.
  • Loading branch information
obar committed May 12, 2020
1 parent 4c8d028 commit 65f10e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Readme.org
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions sublimity.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65f10e4

Please sign in to comment.