diff options
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -1610,12 +1610,32 @@ doc-view-resolution 110 doc-view-continuous t doc-view-conversion-refresh-interval 1) + + :config + + ;; this is an ugly hack: when jao-minibuffer is active, + ;; somehow docview scrolling is not triggering a refresh, + ;; specially for scroll down movements, so we advice the + ;; scrolling functions to force a redisplay by going to + ;; another window. + + (defun jao--refresh (&rest _rest) + (let ((jao-minibuffer-enabled-p nil)) + (other-window 1) (other-window -1))) + + (dolist (f '(doc-view-scroll-up-or-next-page + doc-view-scroll-down-or-previous-page + doc-view-previous-line-or-previous-page + doc-view-next-line-or-next-page + image-eol + image-bol)) + (advice-add f :after #'jao--refresh)) + :bind (:map doc-view-mode-map ("j" . doc-view-next-line-or-next-page) - ("k" . doc-view-previous-line-or-previous-page)) - :custom ((mailcap-user-mime-data - '((doc-view-mode "application/pdf" jao-browse-doc-use-emacs-p) - ("zathura %s" "application/pdf"))))) + ("J" . doc-view-scroll-up-or-next-page) + ("k" . doc-view-previous-line-or-previous-page) + ("K" . doc-view-scroll-down-or-previous-page))) (use-package jao-doc-view :bind (:map doc-view-mode-map |