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
17 lines
548 B
EmacsLisp
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)))))
|