Refactor out -pcase in +treemacs/toggle
This commit is contained in:
parent
dd71f54e5e
commit
4213899b01
1 changed files with 5 additions and 5 deletions
|
@ -10,13 +10,13 @@
|
||||||
project to add."
|
project to add."
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'treemacs)
|
(require 'treemacs)
|
||||||
(-pcase (treemacs--current-visibility)
|
(pcase (treemacs--current-visibility)
|
||||||
['visible (delete-window (treemacs--is-visible?))]
|
(`visible (delete-window (treemacs--is-visible?)))
|
||||||
['exists (treemacs-select-window)]
|
(`exists (treemacs-select-window))
|
||||||
['none
|
(`none
|
||||||
(let ((project-root (doom-project-root 'nocache)))
|
(let ((project-root (doom-project-root 'nocache)))
|
||||||
(when project-root
|
(when project-root
|
||||||
(unless (treemacs--find-project-for-path project-root)
|
(unless (treemacs--find-project-for-path project-root)
|
||||||
(treemacs-add-project-at (treemacs--canonical-path project-root)
|
(treemacs-add-project-at (treemacs--canonical-path project-root)
|
||||||
(doom-project-name 'nocache))))
|
(doom-project-name 'nocache))))
|
||||||
(treemacs--init project-root))]))
|
(treemacs--init project-root)))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue