ui/neotree: fix open/find-this-file commands #992
A not-so-recent update to projectile caused doom-project-root's signature to change (it can now return nil, if not in a project). This fixes +neotree/open and +neotree/find-this-file to account for this new behavior, by resorting to default-directory in the absence of a project.
This commit is contained in:
parent
4063b8d14a
commit
8085a55bcb
1 changed files with 7 additions and 6 deletions
|
@ -8,18 +8,19 @@
|
|||
(defun +neotree/open ()
|
||||
"Open the neotree window in the current project."
|
||||
(interactive)
|
||||
(let ((project-root (doom-project-root)))
|
||||
(require 'neotree)
|
||||
(if (neo-global--window-exists-p)
|
||||
(neotree-hide)
|
||||
(neotree-dir project-root))))
|
||||
(require 'neotree)
|
||||
(if (neo-global--window-exists-p)
|
||||
(neotree-hide)
|
||||
(neotree-dir (or (doom-project-root)
|
||||
default-directory))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +neotree/find-this-file ()
|
||||
"Open the neotree window in the current project, and find the current file."
|
||||
(interactive)
|
||||
(let ((path buffer-file-name)
|
||||
(project-root (doom-project-root)))
|
||||
(project-root (or (doom-project-root)
|
||||
default-directory)))
|
||||
(require 'neotree)
|
||||
(cond ((and (neo-global--window-exists-p)
|
||||
(get-buffer-window neo-buffer-name t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue