mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-18 16:06:56 -05:00
lang/pdf: fix compatibility with +new modeline
This commit is contained in:
@@ -2,8 +2,19 @@
|
||||
|
||||
(def-modeline-segment! +pdf-pages
|
||||
"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)))
|
||||
|
||||
(def-modeline! pdf-tools-modeline
|
||||
(bar matches " " buffer-info +pdf-pages)
|
||||
(major-mode vcs))
|
||||
(if (featurep! :ui doom-modeline +new)
|
||||
(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)
|
||||
'(major-mode vcs)))
|
||||
|
||||
(defun +pdf|init-modeline ()
|
||||
(funcall (if (featurep! :ui doom-modeline +new)
|
||||
#'set-modeline!
|
||||
#'doom-set-modeline)
|
||||
'+pdf))
|
||||
(add-hook 'pdf-tools-enabled-hook #'+pdf|init-modeline)
|
||||
|
Reference in New Issue
Block a user