Refactor out -pcase in +treemacs/toggle

This commit is contained in:
Henrik Lissner 2018-07-01 01:16:37 +02:00
parent dd71f54e5e
commit 4213899b01
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -10,13 +10,13 @@
project to add."
(interactive)
(require 'treemacs)
(-pcase (treemacs--current-visibility)
['visible (delete-window (treemacs--is-visible?))]
['exists (treemacs-select-window)]
['none
(pcase (treemacs--current-visibility)
(`visible (delete-window (treemacs--is-visible?)))
(`exists (treemacs-select-window))
(`none
(let ((project-root (doom-project-root 'nocache)))
(when project-root
(unless (treemacs--find-project-for-path project-root)
(treemacs-add-project-at (treemacs--canonical-path project-root)
(doom-project-name 'nocache))))
(treemacs--init project-root))]))
(treemacs--init project-root)))))