Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions sublimity.el
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@
:type '(repeat symbol)
:group 'sublimity)

(defcustom sublimity-vertical-recenter t
"When non-nil, recenter cursor vertically when it leaves the screen."
:type 'boolean
:group 'sublimity)

;; + minor mode

(defvar sublimity-auto-hscroll-mode nil)
Expand Down Expand Up @@ -173,9 +178,10 @@
(when handle-scroll
(let (deactivate-mark)
;; do vscroll
(with-selected-window sublimity--prev-wnd
(when (not (pos-visible-in-window-p))
(recenter)))
(if sublimity-vertical-recenter
(with-selected-window sublimity--prev-wnd
(when (not (pos-visible-in-window-p))
(recenter))))
;; do hscroll
(when (and sublimity-auto-hscroll-mode
(or truncate-lines
Expand Down