From e2f167fbc59b75d13e1e47e1738d61ac9b862c50 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 7 Aug 2021 16:59:56 -0500 Subject: Show narrowed status in mode-line --- lisp/acdw-modeline.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lisp/acdw-modeline.el') diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 6131484..c073992 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el @@ -80,6 +80,20 @@ indicator in the mode-line." (minions-minor-modes-menu))))) 'mouse-face 'mode-line-highlight))) +(defun acdw-modeline/narrowed () + "Display an indication if the buffer is narrowed." + (when (buffer-narrowed-p) + (concat + "" + (propertize + "N" + 'help-echo (format "%s\n%s" + "Buffer is narrowed" + "mouse-2: widen buffer.") + 'local-map (purecopy (simple-modeline-make-mouse-map + 'mouse-2 #'mode-line-widen)) + 'mouse-face 'mode-line-highlight)))) + (defun acdw-modeline/text-scale () ;; adapted from https://github.com/seagle0128/doom-modeline (when (and (boundp 'text-scale-mode-amount) -- cgit 1.4.1-21-gabe81