Function: treemacs--create-string-for-single-insert

treemacs--create-string-for-single-insert is a byte-compiled function defined in treemacs-rendering.el.

Signature

(treemacs--create-string-for-single-insert PATH PARENT DEPTH)

Documentation

Create the necessary strings to insert a new file node.

Creates the required indent prefix and file icon based on the given file PATH, PARENT node and node DEPTH.

PATH: File Path PARENT: Button DEPTH: Int

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-rendering.el
(define-inline treemacs--create-string-for-single-insert (path parent depth)
  "Create the necessary strings to insert a new file node.
Creates the required indent prefix and file icon based on the given file PATH,
PARENT node and node DEPTH.

PATH: File Path
PARENT: Button
DEPTH: Int"
  (declare (side-effect-free t))
  (inline-letevals (path depth parent)
    (inline-quote
     (let ((prefix (treemacs--get-indentation ,depth)))
       (apply
        #'concat
        (let* ((strs)
               (face))
          (if (file-directory-p ,path)
              (setf
               strs (treemacs--create-dir-button-strings
                     ,path prefix ,parent ,depth)
               face 'treemacs-directory-face)
            (setf strs (treemacs--create-file-button-strings
                        ,path prefix ,parent ,depth)
                  face 'treemacs-file-face))
          (-let [last (-last-item strs)]
            (put-text-property 0 (length last) 'face face last))
          strs))))) )