Merge pull request #911 from UndeadKernel/fix-pdf-modeline

tools/pdf: recognize modeline and doom-modeline
This commit is contained in:
Henrik Lissner 2018-09-26 09:23:34 -04:00 committed by GitHub
commit 784dcf45f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -4,16 +4,16 @@
"Current and total page indicator for PDF documents." "Current and total page indicator for PDF documents."
(format "P %d/%d" (pdf-view-current-page) (pdf-cache-number-of-pages))) (format "P %d/%d" (pdf-view-current-page) (pdf-cache-number-of-pages)))
(if (featurep! :ui doom-modeline +new) (if (featurep! :ui modeline)
(def-modeline-format! '+pdf (def-modeline-format! '+pdf
'(+mode-line-bar " " +mode-line-buffer-id " " +pdf-pages) '(+mode-line-bar " " +mode-line-buffer-id " " +pdf-pages)
'(+mode-line-major-mode +mode-line-vcs)) '(+mode-line-major-mode +mode-line-vcs))
(def-modeline! '+pdf (def-modeline! '+pdf
'(bar matches " " buffer-info +pdf-pages) '(bar matches " " buffer-info " " +pdf-pages)
'(major-mode vcs))) '(major-mode vcs)))
(defun +pdf|init-modeline () (defun +pdf|init-modeline ()
(funcall (if (featurep! :ui doom-modeline +new) (funcall (if (featurep! :ui modeline)
#'set-modeline! #'set-modeline!
#'doom-set-modeline) #'doom-set-modeline)
'+pdf)) '+pdf))

View file

@ -30,7 +30,7 @@
;; Turn off cua so copy works ;; Turn off cua so copy works
(add-hook! 'pdf-view-mode-hook (cua-mode 0)) (add-hook! 'pdf-view-mode-hook (cua-mode 0))
;; Custom modeline that removes useless info and adds page numbers ;; Custom modeline that removes useless info and adds page numbers
(when (featurep! :ui doom-modeline) (when (or (featurep! :ui doom-modeline) (featurep! :ui modeline))
(load! "+modeline")) (load! "+modeline"))
;; Handle PDF-tools related popups better ;; Handle PDF-tools related popups better
(set-popup-rule! "^\\*Outline*" :side 'right :size 40 :select nil) (set-popup-rule! "^\\*Outline*" :side 'right :size 40 :select nil)