Function: hydra--pad-heads

hydra--pad-heads is a byte-compiled function defined in hydra.el.

Signature

(hydra--pad-heads HEADS-GROUPS PADDING-HEAD)

Documentation

Return a copy of HEADS-GROUPS padded where applicable with PADDING-HEAD.

Source Code

;; Defined in ~/.emacs.d/elpa/hydra-20250316.1254/hydra.el
(defun hydra--pad-heads (heads-groups padding-head)
  "Return a copy of HEADS-GROUPS padded where applicable with PADDING-HEAD."
  (cl-loop for heads-group in heads-groups
     for this-head-group-length = (length heads-group)
     with head-group-max-length = (apply #'max (mapcar (lambda (heads) (length heads)) heads-groups))
     if (<= this-head-group-length head-group-max-length)
     collect (append heads-group (make-list (- head-group-max-length this-head-group-length) padding-head))
     into balanced-heads-groups
     else collect heads-group into balanced-heads-groups
     finally return balanced-heads-groups))