aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilij Schneidermann <mail@vasilij.de>2020-06-08 15:39:17 +0200
committerVasilij Schneidermann <mail@vasilij.de>2020-06-08 15:39:17 +0200
commit3d32aac0f895c8605e254c8b7f246537816744f5 (patch)
treeb7b3cda9fc0052e826a21460f4754e0d481b4f70
parent4889373f1f3cd0e7277b5c3a52ff80bdcbf86b4e (diff)
Recenter after nov-history-back/-forward
-rw-r--r--nov.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/nov.el b/nov.el
index 1f509b1..94e26c9 100644
--- a/nov.el
+++ b/nov.el
@@ -729,7 +729,8 @@ Saving is only done if `nov-save-place-file' is set."
(nov-goto-document index)
(setq nov-history (cdr nov-history))
(setq nov-history-forward history-forward)
- (goto-char opoint)))
+ (goto-char opoint)
+ (recenter (1- (max 1 scroll-margin)))))
(defun nov-history-forward ()
"Go forward in the history of visited documents."
@@ -740,7 +741,8 @@ Saving is only done if `nov-save-place-file' is set."
((index opoint) (car nov-history-forward)))
(nov-goto-document index)
(setq nov-history-forward history-forward)
- (goto-char opoint)))
+ (goto-char opoint)
+ (recenter (1- (max 1 scroll-margin)))))
;;;###autoload
(define-derived-mode nov-mode special-mode "EPUB"