Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only show info-nodes when in Info-mode #748

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions doom-modeline-segments.el
Original file line number Diff line number Diff line change
Expand Up @@ -1909,26 +1909,28 @@ mouse-3: Describe current input method")

(doom-modeline-def-segment info-nodes
"The topic and nodes in the Info buffer."
(concat
" ("
;; topic
(propertize (if (stringp Info-current-file)
(replace-regexp-in-string
"%" "%%"
(file-name-sans-extension
(file-name-nondirectory Info-current-file)))
(format "*%S*" Info-current-file))
'face (doom-modeline-face 'doom-modeline-info))
") "
;; node
(when Info-current-node
(propertize (replace-regexp-in-string
"%" "%%" Info-current-node)
'face (doom-modeline-face 'doom-modeline-buffer-path)
'help-echo
"mouse-1: scroll forward, mouse-3: scroll back"
'mouse-face 'doom-modeline-highlight
'local-map Info-mode-line-node-keymap))))
(when (and (fboundp 'Info-mode)
(eq major-mode 'Info-mode))
(concat
" ("
;; topic
(propertize (if (stringp Info-current-file)
(replace-regexp-in-string
"%" "%%"
(file-name-sans-extension
(file-name-nondirectory Info-current-file)))
(format "*%S*" Info-current-file))
'face (doom-modeline-face 'doom-modeline-info))
") "
;; node
(when Info-current-node
(propertize (replace-regexp-in-string
"%" "%%" Info-current-node)
'face (doom-modeline-face 'doom-modeline-buffer-path)
'help-echo
"mouse-1: scroll forward, mouse-3: scroll back"
'mouse-face 'doom-modeline-highlight
'local-map Info-mode-line-node-keymap)))))


;;
Expand Down