Function: treemacs--insert-single-node

treemacs--insert-single-node is a byte-compiled function defined in treemacs-rendering.el.

Signature

(treemacs--insert-single-node CREATED-PATH PARENT-BTN PARENT-DOM-NODE)

Documentation

Insert new CREATED-PATH below non-flattened directory at PARENT-BTN.

Will find the correct insert location, insert the necessary strings, and make the necessary dom entries and adjust PARENT-DOM-NODE.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-rendering.el
(defun treemacs--insert-single-node (created-path parent-btn parent-dom-node)
  "Insert new CREATED-PATH below non-flattened directory at PARENT-BTN.
Will find the correct insert location, insert the necessary strings, and make
the necessary dom entries and adjust PARENT-DOM-NODE."
  (let* ((sort-function (treemacs--get-sort-fuction))
         (insert-after (treemacs--determine-insert-position created-path parent-btn sort-function)))
    (goto-char insert-after)
    (end-of-line)
    (insert "\n" (treemacs--create-string-for-single-insert
                  created-path parent-btn (1+ (button-get parent-btn :depth))))
    (-let [new-dom-node (treemacs-dom-node->create! :key created-path :parent parent-dom-node)]
      (treemacs-dom-node->insert-into-dom! new-dom-node)
      (treemacs-dom-node->add-child! parent-dom-node new-dom-node))
    (when treemacs-git-mode
      (treemacs-do-update-single-file-git-state created-path :exclude-parents :override-status))))