From 6a2f2f38f074cfb2d7afff0de883c02a9d5e2954 Mon Sep 17 00:00:00 2001 From: bth Date: Wed, 27 May 2026 12:40:46 -0700 Subject: [PATCH] minmo : add space before un/tracked status --- packages/minmo.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/minmo.el b/packages/minmo.el index e963963..85451f0 100644 --- a/packages/minmo.el +++ b/packages/minmo.el @@ -89,15 +89,15 @@ Uses the fast `vc-state' cache rather than synchronous git calls." (let* ((state (vc-state file))) (setq minmo--vc-branch-cache (minmo--fetch-vc-branch file)) (setq minmo--vc-tracked-cache - (pcase state - ;; NOTE: vc-mode adds its own space prefix to vc-git-mode-line-string: - ('up-to-date (minmo--status 'unmodified 'git)) - ('edited (minmo--status 'modified/staged 'git)) - ('added (minmo--status 'new 'git)) - ('needs-merge (minmo--status 'modified/staged 'git)) - ('conflict (minmo--status 'modified/staged 'git)) - (_ (minmo--status 'unmodified 'git)) - )))) + (concat " " (pcase state + ;; NOTE: vc-mode adds its own space prefix to vc-git-mode-line-string: + ('up-to-date (minmo--status 'unmodified 'git)) + ('edited (minmo--status 'modified/staged 'git)) + ('added (minmo--status 'new 'git)) + ('needs-merge (minmo--status 'modified/staged 'git)) + ('conflict (minmo--status 'modified/staged 'git)) + (_ (minmo--status 'unmodified 'git)) + ))))) ;; NOTE: :override replaces the function (advice-add #'vc-git-mode-line-string :override #'minmo--vc-tracked-status-override) @@ -128,11 +128,11 @@ Uses the fast `vc-state' cache rather than synchronous git calls." (let ((state (vc-git-state buffer-file-name))) (setq minmo--vc-branch-cache (minmo--fetch-vc-branch buffer-file-name)) (setq minmo--vc-untracked-cache - (pcase state - ;; NOTE: we need the space prefix to match the output of vc-mode: - ('unregistered (minmo--status 'nofile/untracked 'git)) - ('ignored (minmo--status 'readonly/ignored 'git)) - (_ nil)))))) + (concat " " (pcase state + ;; NOTE: we need the space prefix to match the output of vc-mode: + ('unregistered (minmo--status 'nofile/untracked 'git)) + ('ignored (minmo--status 'readonly/ignored 'git)) + (_ nil))))))) ;; NOTE: update the state when the file state changes ;; this is the only remaining part of this approach which is somewhat hacky, in