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." 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)))))