doomemacs/modules/ui/treemacs/autoload.el
Henrik Lissner f9dfb7e92a
tweak(treemacs): use treemacs-add-and-display-current-project-exclusively
Folks seem to expect to *only* see the current project in the treemacs
pane when they open it. I sort of agree, so I've tweaked
+treemacs/toggle (on SPC o p) to use
`treemacs-add-and-display-current-project-exclusively` instead.

Fix: #7614
2024-07-01 18:10:06 -04:00

17 lines
548 B
EmacsLisp

;;; ui/treemacs/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +treemacs/toggle ()
"Initialize or toggle treemacs.
Ensures that only the current project is present and all other projects have
been removed.
Use `treemacs' command for old functionality."
(interactive)
(require 'treemacs)
(pcase (treemacs-current-visibility)
(`visible (delete-window (treemacs-get-local-window)))
(_ (if (treemacs--find-current-user-project)
(treemacs-add-and-display-current-project-exclusively)
(treemacs)))))