Function: treemacs--render-projects

treemacs--render-projects is a byte-compiled function defined in treemacs-rendering.el.

Signature

(treemacs--render-projects PROJECTS)

Documentation

Actually render the given PROJECTS in the current buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-rendering.el
(defun treemacs--render-projects (projects)
  "Actually render the given PROJECTS in the current buffer."
  (treemacs-with-writable-buffer
   (unless treemacs--projects-end
     (setq treemacs--projects-end (make-marker)))
   (let* ((projects (-reject #'treemacs-project->is-disabled? projects))
          (current-workspace (treemacs-current-workspace))
          (has-previous (when (fboundp 'treemacs--apply-root-top-extensions)
                          (treemacs--apply-root-top-extensions current-workspace))))

     (--each projects
       (when has-previous (treemacs--insert-root-separator))
       (setq has-previous t)
       (treemacs--add-root-element it))

     ;; Set the end marker after inserting the extensions. Otherwise, the
     ;; extensions would move the marker.
     (let ((projects-end-point (point)))
       (when (fboundp 'treemacs--apply-root-bottom-extensions)
         (treemacs--apply-root-bottom-extensions current-workspace has-previous))
       ;; If the marker lies at the start of the buffer, expanding extensions would
       ;; move the marker. Make sure that the marker does not move when doing so.
       (set-marker-insertion-type treemacs--projects-end has-previous)
       (set-marker treemacs--projects-end projects-end-point)))))