From 8a2e5ffbdaf9df02a96a31f0072e2a740392ed13 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Fri, 7 Dec 2018 00:16:19 +0800 Subject: [PATCH] Add help-echo and mouse-click for buffer position and size. --- doom-modeline.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 29b65a7..d8e235d 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -1168,7 +1168,12 @@ of active `multiple-cursors'." (doom-modeline--symbol-overlay) (doom-modeline--multiple-cursors)))) (or (and (not (equal meta "")) meta) - (if buffer-file-name " %I ")))) + (if (and buffer-file-name size-indication-mode) + (propertize " %I " + 'help-echo "Buffer size\n\ +mouse-1: Display Line and Column Mode Menu" + 'local-map mode-line-column-line-number-mode-map + 'mouse-face 'mode-line-highlight))))) ;; @@ -1361,7 +1366,11 @@ See `mode-line-percent-position'.") (doom-modeline-def-segment buffer-position "The buffer position information." - '(" " mode-line-position)) + `(:propertize (concat " " mode-line-position) + help-echo "Buffer position\n\ +mouse-1: Display Line and Column Mode Menu" + local-map ,mode-line-column-line-number-mode-map + mouse-face mode-line-highlight)) ;;