tools/pdf: recognize modeline and doom-modeline

This commit is contained in:
UndeadKernel 2018-09-26 12:55:22 +02:00
parent 9afc61e57e
commit 239c183b70
2 changed files with 4 additions and 4 deletions

View file

@ -4,16 +4,16 @@
"Current and total page indicator for PDF documents."
(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
'(+mode-line-bar " " +mode-line-buffer-id " " +pdf-pages)
'(+mode-line-major-mode +mode-line-vcs))
(def-modeline! '+pdf
'(bar matches " " buffer-info +pdf-pages)
'(bar matches " " buffer-info " " +pdf-pages)
'(major-mode vcs)))
(defun +pdf|init-modeline ()
(funcall (if (featurep! :ui doom-modeline +new)
(funcall (if (featurep! :ui modeline)
#'set-modeline!
#'doom-set-modeline)
'+pdf))

View file

@ -30,7 +30,7 @@
;; Turn off cua so copy works
(add-hook! 'pdf-view-mode-hook (cua-mode 0))
;; 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"))
;; Handle PDF-tools related popups better
(set-popup-rule! "^\\*Outline*" :side 'right :size 40 :select nil)