                (setq-local doom--modeline-format (doom-modeline modeline))
                (when doom--modeline-format
                  (doom-hide-modeline-mode +1)))))
-    ;; show modeline
     (when doom-hide-modeline-mode
       (doom-hide-modeline-mode -1))))
+(add-hook 'doom-popup-mode-hook #'doom|hide-modeline-in-popup)
 
 ;;
 (defun doom*popup-init (orig-fn &rest args)

    (let ((last (current-buffer)))
      (cond ((when-let (dest (doom-buffers-in-mode
                              'magit-mode
                              (cl-remove-if (lambda (buf) (eq buf last))
                                            (mapcar #'car (window-prev-buffers)))
                              t))
               (doom-popup-switch-to-buffer (car dest)))
             (kill-buffer last))

          (window (selected-window)))
      (apply orig-fn args)
      (when popup-p (doom/popup-close window))))
  (advice-add #'xref-goto-xref :around #'doom*xref-follow-and-close))


;; Ensure these settings are attached to org-load-hook as late as possible,
