                         :bold t)))
 (spacemacs/defface-micro-state-faces)
 
+(defun spacemacs//micro-state-set-minibuffer-height (str)
+  "Set the max mini windows size given a string STR."
+  (let ((line-count (1+ (how-many-str "\n" str))))
+    (when (and (> line-count max-mini-window-height)
+               (> line-count 10))
+      (setq max-mini-window-height line-count))))
+
 (defmacro spacemacs|define-micro-state (name &rest props)
   "Define a micro-state called NAME.
 

                                (format "%S: %s" ',name bdoc))))
                (when (and defdoc
                           ',wrapped (not (plist-get ',binding :exit)))
                  (setq max-mini-window-height (1+ (how-many-str "\n" defdoc)))
                  (apply ',msg-func
                         (list (spacemacs//micro-state-propertize-doc
                                (format "%S: %s" ',name defdoc)))))))))

                   (setq throwp nil))
                 ,@binding-post
                 (when throwp (throw 'exit nil)))
               (when ,@doc-body
                 (spacemacs//micro-state-set-minibuffer-height ,@doc-body)
                 ,@doc-body)))))
    (append (list (car binding) (eval wrapper-func)) binding)))

(defun spacemacs//micro-state-fill-map-sexps (wrappers)
