 (def-modeline-segment! vcs
   "Displays the current branch, colored based on its state."
   (when (and vc-mode buffer-file-name)
-    (let ((backend (vc-backend buffer-file-name))
-          (state   (vc-state buffer-file-name))
-          (face    'mode-line-inactive)
-          (active  (active))
-          (all-the-icons-scale-factor 1.0)
-          (all-the-icons-default-adjust -0.1))
-      (concat "  "
-              (cond ((memq state '(edited added))
-                     (if active (setq face 'doom-modeline-info))
-                     (all-the-icons-octicon
-                      "git-compare"
-                      :face face
-                      :height 1.2
-                      :v-adjust -0.05))
-                    ((eq state 'needs-merge)
-                     (if active (setq face 'doom-modeline-info))
-                     (all-the-icons-octicon "git-merge" :face face))
-                    ((eq state 'needs-update)
-                     (if active (setq face 'doom-modeline-warning))
-                     (all-the-icons-octicon "arrow-down" :face face))
-                    ((memq state '(removed conflict unregistered))
-                     (if active (setq face 'doom-modeline-urgent))
-                     (all-the-icons-octicon "alert" :face face))
-                    (t
-                     (if active (setq face 'font-lock-doc-face))
-                     (all-the-icons-octicon
-                      "git-compare"
-                      :face face
-                      :height 1.2
-                      :v-adjust -0.05)))
-              " "
-              (propertize (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2))
-                          'face (if active face))
-              " "))))
+    (let* ((backend (vc-backend buffer-file-name))
+           (state   (vc-state buffer-file-name backend)))
+      (let ((face    'mode-line-inactive)
+            (active  (active))
+            (all-the-icons-scale-factor 1.0)
+            (all-the-icons-default-adjust -0.1))
+        (concat "  "
+                (cond ((memq state '(edited added))
+                       (if active (setq face 'doom-modeline-info))
+                       (all-the-icons-octicon
+                        "git-compare"
+                        :face face
+                        :height 1.2
+                        :v-adjust -0.05))
+                      ((eq state 'needs-merge)
+                       (if active (setq face 'doom-modeline-info))
+                       (all-the-icons-octicon "git-merge" :face face))
+                      ((eq state 'needs-update)
+                       (if active (setq face 'doom-modeline-warning))
+                       (all-the-icons-octicon "arrow-down" :face face))
+                      ((memq state '(removed conflict unregistered))
+                       (if active (setq face 'doom-modeline-urgent))
+                       (all-the-icons-octicon "alert" :face face))
+                      (t
+                       (if active (setq face 'font-lock-doc-face))
+                       (all-the-icons-octicon
+                        "git-compare"
+                        :face face
+                        :height 1.2
+                        :v-adjust -0.05)))
+                " "
+                (propertize (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2))
+                            'face (if active face))
+                " ")))))
 
 ;;
 (defun +doom-ml-icon (icon &optional text face voffset)
   "Displays an octicon ICON with FACE, followed by TEXT. Uses
 `all-the-icons-octicon' to fetch the icon."
-  (concat
-   (if vc-mode " " "  ")
-   (when icon
-     (concat
-      (all-the-icons-material icon :face face :height 1.1 :v-adjust (or voffset -0.2))
-      ;; (all-the-icons-octicon icon :face face :height 1.0 :v-adjust 0)
-      (if text +doom-modeline-vspc)))
-   (when text
-     (propertize text 'face face))
-   (if vc-mode "  " " ")))
+  (concat (if vc-mode " " "  ")
+          (when icon
+            (concat
+             (all-the-icons-material icon :face face :height 1.1 :v-adjust (or voffset -0.2))
+             (if text +doom-modeline-vspc)))
+          (when text
+            (propertize text 'face face))
+          (if vc-mode "  " " ")))
 
 (def-modeline-segment! flycheck
   "Displays color-coded flycheck error status in the current buffer with pretty

(def-package! eldoc-eval
  :demand t
  :config
  ;; Show eldoc in the mode-line with `eval-expression'
  (defun +doom-modeline--show-eldoc (input)
    "Display string STR in the mode-line next to minibuffer."
    (with-current-buffer (eldoc-current-buffer)
      (let* ((str              (and (stringp input) input))
             (mode-line-format (or (and str (or (doom-modeline 'eldoc) str))
                                   mode-line-format))
             mode-line-in-non-selected-windows)
        (force-mode-line-update)

       (format " %s/%d "
               (if this-oc
                   (- length
                      (length (memq this-oc (sort (append iedit-occurrences-overlays nil)
                                                  #'doom-themes--overlay-sort)))
                      -1)
                 "-")
               length))
     'face (if (active) 'doom-modeline-panel))))
