Open Nondv opened 5 years ago
This is what I found in the package
(defun neo-buffer--execute (arg &optional file-fn dir-fn)
"Define the behaviors for keyboard event.
ARG is the parameter for command.
If FILE-FN is non-nil, it will executed when a file node.
If DIR-FN is non-nil, it will executed when a dir node."
(interactive "P")
(let* ((btn-full-path (neo-buffer--get-filename-current-line))
is-file-p
enter-fn)
(unless (null btn-full-path)
(setq is-file-p (not (file-directory-p btn-full-path))
enter-fn (if is-file-p file-fn dir-fn))
(unless (null enter-fn)
(funcall enter-fn btn-full-path arg)
(run-hook-with-args
'neo-enter-hook
(if is-file-p 'file 'directory)
btn-full-path
arg)))
btn-full-path))
I guess the described behavior is expected but confusing. Is there a hook for opening files?
Yea looks like the behavior is expected. I think the intention with this one is if you click on a file with your mouse then it'll auto hide neotree.
You do bring up a good point that neotree could use a hook for opening files.
Hello,
From #77 I found out about
neo-enter-hook
and used it like this:Though it is being triggered even by moving in neotree buffer via
n
orp
.Arguments are the same as when using
RET
:Is this expected behavior?