From e27473dd23e3aa78974dcc66f7119929a5c4c2e3 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 23 Jul 2020 16:45:16 +0800 Subject: [PATCH] Display buffer state in buffer-default-directory segment. See #368. --- doom-modeline-segments.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 477ccda..2d6153e 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -225,20 +225,6 @@ ;; Buffer information ;; -(doom-modeline-def-segment buffer-default-directory - "Displays `default-directory'. This is for special buffers like the scratch -buffer where knowing the current project directory is important." - (let* ((active (doom-modeline--active)) - (face (if active 'doom-modeline-buffer-path 'mode-line-inactive))) - (concat (doom-modeline-spc) - (and doom-modeline-major-mode-icon - (concat (doom-modeline-icon - 'octicon "file-directory" "🖿" "" - :face face :v-adjust -0.05 :height 1.25) - (doom-modeline-vspc))) - (propertize (abbreviate-file-name default-directory) 'face face)))) - -;; (defvar-local doom-modeline--buffer-file-icon nil) (defun doom-modeline-update-buffer-file-icon (&rest _) "Update file icon in mode-line." @@ -421,6 +407,20 @@ directory, the file name, and its state (modified, read-only or non-existent)." mouse-1: Previous buffer\nmouse-3: Next buffer" 'local-map mode-line-buffer-identification-keymap))) +(doom-modeline-def-segment buffer-default-directory + "Displays `default-directory'. This is for special buffers like the scratch +buffer where knowing the current project directory is important." + (let* ((active (doom-modeline--active)) + (face (if active 'doom-modeline-buffer-path 'mode-line-inactive))) + (concat (doom-modeline-spc) + (doom-modeline--buffer-state-icon) + (and doom-modeline-major-mode-icon + (concat (doom-modeline-icon + 'octicon "file-directory" "🖿" "" + :face face :v-adjust -0.05 :height 1.25) + (doom-modeline-vspc))) + (propertize (abbreviate-file-name default-directory) 'face face)))) + ;; ;; Encoding