Skip to content

Commit

Permalink
Fixing some isues with the auto refresh
Browse files Browse the repository at this point in the history
The force root change is now enabled by default. Also, the autorefresh won't be perfomed if the current buffer is not a file. This should partially solve jaypei#286.
  • Loading branch information
palikar committed Nov 20, 2018
1 parent 69df453 commit f66e8be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neotree.el
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ This variable is used in `neo-vc-for-node' when
:type 'boolean
:group 'neotree)

(defcustom neo-force-change-root nil
(defcustom neo-force-change-root t
"If not nil, do not prompt when switching root."
:type 'boolean
:group 'neotree)
Expand Down Expand Up @@ -777,7 +777,8 @@ If INIT-P is non-nil and global NeoTree buffer not exists, then create it."
(defun neo-global--do-autorefresh ()
"Do auto refresh."
(interactive)
(when (and neo-autorefresh (neo-global--window-exists-p))
(when (and neo-autorefresh (neo-global--window-exists-p)
(buffer-file-name))
(neotree-refresh t)))

(defun neo-global--open ()
Expand Down

0 comments on commit f66e8be

Please sign in to comment.