From c3f57fa9969f69a3ee6a30a3c56aa40177cf930c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 19 Sep 2016 17:46:37 +0200 Subject: [PATCH] Update custom-write (still a WIP) --- modules/custom-write.el | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/modules/custom-write.el b/modules/custom-write.el index d62a3df58..3b3d81ff7 100644 --- a/modules/custom-write.el +++ b/modules/custom-write.el @@ -14,19 +14,33 @@ (defconst write-mode--last-theme doom-current-theme) (defconst write-mode--last-line-spacing line-spacing) -(after! spaceline - (spaceline-compile - 'write - '(((*macro-recording *anzu *iedit *evil-substitute *flycheck) - :skip-alternate t - :tight t) - *buffer-path - *buffer-modified) - '((*selection-info :when active) - *buffer-encoding-abbrev - (global :when active) - *buffer-position - *pad))) +(defun doom-write-mode-line (&optional id) + `(:eval + (let* ((active (eq (selected-window) mode-line-selected-window)) + (lhs (list (propertize " " + 'display + (pl/percent-xpm doom-modeline-height 100 0 100 0 3 + (face-attribute (if active 'doom-modeline-bar 'doom-modeline-inactive-bar) :background nil t) + nil)) + (*flycheck) + (*macro-recording) + (*selection-info) + (*anzu) + (*evil-substitute) + (*iedit) + " " + ,(if (eq id 'scratch) + '(*buffer-pwd) + '(list (*buffer-path) (*buffer-name) " ")) + (*buffer-state))) + (rhs (list (*buffer-encoding-abbrev) " " + (*vc) " " + (*major-mode) " " + (*buffer-position))) + (middle (propertize + " " 'display `((space :align-to (- (+ right right-fringe right-margin) + ,(1+ (string-width (format-mode-line rhs))))))))) + (list lhs middle rhs)))) (defvar write-mode nil) (defun doom/write-mode ()