Function: eca-workspaces--cell

eca-workspaces--cell is a natively compiled function defined in eca-workspaces.el.

Signature

(eca-workspaces--cell TEXT WIDTH &optional TRUNCATE)

Documentation

Return TEXT padded to WIDTH columns.

When TRUNCATE is non-nil, TEXT wider than WIDTH is truncated with an ellipsis. When WIDTH is nil return TEXT unchanged. Padding spaces carry no face so underlined cells do not bleed into the whitespace.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-workspaces.el
(defun eca-workspaces--cell (text width &optional truncate)
  "Return TEXT padded to WIDTH columns.
When TRUNCATE is non-nil, TEXT wider than WIDTH is truncated with
an ellipsis.  When WIDTH is nil return TEXT unchanged.  Padding
spaces carry no face so underlined cells do not bleed into the
whitespace."
  (if (null width)
      text
    (let ((text (if (and truncate (> (string-width text) (1- width)))
                    (truncate-string-to-width text (- width 2) nil nil "…")
                  text)))
      (concat text
              (make-string (max 1 (- width (string-width text))) ?\s)))))