From 01466fba5567f001f55e72ea4c04062dce1b4b62 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 5 Oct 2016 12:50:36 +0200 Subject: [PATCH] modeline: fix name display in unnamed buffers --- core/core-modeline.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core-modeline.el b/core/core-modeline.el index f936a9497..825eb4c44 100644 --- a/core/core-modeline.el +++ b/core/core-modeline.el @@ -129,7 +129,7 @@ cached the first time." (defun doom-buffer-path () "Displays the buffer's full path relative to the project root (includes the project root). Excludes the file basename. See `doom-buffer-name' for that." - (when buffer-file-name + (if buffer-file-name (let* ((default-directory (f-dirname buffer-file-name)) (buffer-path (f-relative buffer-file-name (doom/project-root))) (max-length (truncate (* (window-body-width) 0.4)))) @@ -147,7 +147,8 @@ project root). Excludes the file basename. See `doom-buffer-name' for that." (when (string-suffix-p "/" output) (setq output (substring output 0 -1))) output) - buffer-path))))) + buffer-path))) + "%b")) ;;