fix(treemacs): open last treemacs session if in $HOME or non-project
`treemacs-add-and-display-current-project-exclusively' seems to confuse
some people and please others when it is used in $HOME. To reduce
confusion, SPC o p will now resume from the last session if
default-directory isn't a valid project OR if it's $HOME. It will also
emit a warning informing them of that.
Fix: #7948
Amend: f9dfb7e92a
This commit is contained in:
parent
bd728fd2a8
commit
3f66400d62
1 changed files with 5 additions and 3 deletions
|
@ -12,6 +12,8 @@ Use `treemacs' command for old functionality."
|
|||
(require 'treemacs)
|
||||
(pcase (treemacs-current-visibility)
|
||||
(`visible (delete-window (treemacs-get-local-window)))
|
||||
(_ (if (treemacs--find-current-user-project)
|
||||
(_ (let ((project (treemacs--find-current-user-project)))
|
||||
(if (and project (not (file-equal-p project "~")))
|
||||
(treemacs-add-and-display-current-project-exclusively)
|
||||
(treemacs)))))
|
||||
(message "No valid project in current buffer; opening last treemacs session")
|
||||
(treemacs))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue