Function: treemacs--build-indentation-cache

treemacs--build-indentation-cache is a byte-compiled function defined in treemacs-visuals.el.

Signature

(treemacs--build-indentation-cache DEPTH)

Documentation

Rebuild indentation string cache up to DEPTH levels deep.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-visuals.el
(defun treemacs--build-indentation-cache (depth)
  "Rebuild indentation string cache up to DEPTH levels deep."
  (setq treemacs--indentation-string-cache
        (make-vector (1+ depth) nil)
        treemacs--indentation-string-cache-key
        (cons treemacs-indentation treemacs-indentation-string))
  (dotimes (i (1+ depth))
    (aset treemacs--indentation-string-cache i
          (cond
           ((listp treemacs-indentation-string)
            (let ((str nil)
                  (len (length treemacs-indentation-string)))
              (dotimes (n i)
                (setf str (concat str
                                  (nth (% n len) treemacs-indentation-string))))
              str))
           ((integerp treemacs-indentation)
            (s-repeat (* i treemacs-indentation) treemacs-indentation-string))
           ((not window-system)
            (s-repeat (* i 2) treemacs-indentation-string))
           (t (propertize " "
                          'display
                          `(space . (:width (,(* (car treemacs-indentation)
                                                 i))))))))))