 (defvar +doom-modeline-current-window (frame-selected-window))
 (defun +doom-modeline|set-selected-window (&rest _)
   "Sets `+doom-modeline-current-window' appropriately"
-  (unless (minibuffer-window-active-p (frame-selected-window))
-    (setq +doom-modeline-current-window (frame-selected-window))))
+  (let ((win (frame-selected-window)))
+    (unless (minibuffer-window-active-p win)
+      (setq +doom-modeline-current-window win))))
 
 (add-hook 'window-configuration-change-hook '+doom-modeline|set-selected-window)
 (add-hook 'focus-in-hook '+doom-modeline|set-selected-window)

                                     :v-adjust -0.05)
              sep))))

(defvar iedit-mode nil)
(defvar anzu--state nil)
(defsubst +doom-modeline--anzu ()
  "Show the match index and total number thereof. Requires `anzu', also
`evil-anzu' if using `evil-mode' for compatibility with `evil-search'."

  (save-excursion (goto-char pos)
                  (current-column)))

(def-modeline-segment! selection-info
  "Information about the current selection, such as how many characters and
lines are selected, or the NxM dimensions of a block selection."
