Simplify neotree-project-dir-toggle function

This commit is contained in:
2017-12-22 17:08:03 +00:00
parent 6c498bfadb
commit e49dd02ba7

View File

@@ -29,18 +29,10 @@ or the current buffer directory."
"Toggle opening NeoTree using the project root, using find-file-in-project,
or the current buffer directory."
(interactive)
(let ((project-dir (ignore-errors (projectile-project-root)))
(file-name (buffer-file-name))
(neo-smart-open nil))
(if (and (fboundp 'neo-global--window-exists-p)
(neo-global--window-exists-p))
(neotree-hide)
(progn
(neotree-show)
(if project-dir
(neotree-dir project-dir))
(if file-name
(neotree-find file-name))))))
(if (and (fboundp 'neo-global--window-exists-p)
(neo-global--window-exists-p))
(neotree-hide)
(neotree-project-dir)))
:config
(require 'siren-projectile)