neotree: fix open-and-find

This commit is contained in:
Henrik Lissner 2016-03-12 00:46:22 -05:00
parent 533101628c
commit 615d06442c

View file

@ -7,14 +7,15 @@
(interactive)
(let ((in-neotree (and (neo-global--window-exists-p)
(window-live-p neo-global--buffer)
(eq (current-buffer) neo-global--buffer))))
(eq (current-buffer) neo-global--buffer)))
(path buffer-file-name))
(if in-neotree
(neotree-hide)
(let ((project-root (narf/project-root)))
(unless (and (neo-global--window-exists-p)
(f-same? (neo-global--with-window neo-buffer--start-node) project-root))
(neotree-dir project-root)))
(neotree-find))))
(neotree-dir project-root))
(neotree-find path project-root)))))
;;;###autoload
(defun narf|neotree-close-on-window-change (&rest _)