parent
e932c74758
commit
d0295a26d4
1 changed files with 9 additions and 7 deletions
|
@ -4,10 +4,8 @@
|
||||||
(defun +treemacs/toggle ()
|
(defun +treemacs/toggle ()
|
||||||
"Initialize or toggle treemacs.
|
"Initialize or toggle treemacs.
|
||||||
|
|
||||||
* If the treemacs window is visible hide it.
|
Ensures that only the current project is present and all other projects have
|
||||||
* If a treemacs buffer exists, but is not visible show it.
|
been removed."
|
||||||
* If no treemacs buffer exists for the current frame create and show it.
|
|
||||||
* If the workspace is empty, add the current project to it automatically."
|
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'treemacs)
|
(require 'treemacs)
|
||||||
(let ((origin-buffer (current-buffer)))
|
(let ((origin-buffer (current-buffer)))
|
||||||
|
@ -15,9 +13,13 @@
|
||||||
(symbol-function 'ignore)))
|
(symbol-function 'ignore)))
|
||||||
(treemacs--init))
|
(treemacs--init))
|
||||||
;;
|
;;
|
||||||
(treemacs-do-add-project-to-workspace
|
(dolist (project (treemacs-workspace->projects (treemacs-current-workspace)))
|
||||||
(treemacs--canonical-path (doom-project-root 'nocache))
|
(treemacs-do-remove-project-from-workspace project))
|
||||||
(doom-project-name 'nocache))
|
;;
|
||||||
|
(with-current-buffer origin-buffer
|
||||||
|
(treemacs-do-add-project-to-workspace
|
||||||
|
(treemacs--canonical-path (doom-project-root 'nocache))
|
||||||
|
(doom-project-name 'nocache)))
|
||||||
;;
|
;;
|
||||||
(setq treemacs--ready-to-follow t)
|
(setq treemacs--ready-to-follow t)
|
||||||
(when (or treemacs-follow-after-init treemacs-follow-mode)
|
(when (or treemacs-follow-after-init treemacs-follow-mode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue