Also improved some highlighting to make use of g:NERDTreeNodeDelimiter,
which directly surrounds the filename. More of this to come as errors
are tracked down and fixed in this file.
There was a fix in #1043 which improves the behavior for non saved
filenames. Those are not on disk, but also not empty. This lead to an
issue #1059 where actual "empty files" like created with vim-startify or
stdin lead to an error. This change fixes this by adapting the order of
the tests. It'll print "no file for the current buffer" for empty files.
Solves #1059
VIM noob here, so code might not be optimal.
My setup is as follows.
NVIM v0.5.0-95-g2e14dffbb, Linux Mint 19.2.
I have this in init.vim
```vim
set clipboard=unnamedplus
```
This enables me to share clipboard between VIM and X clipboard.
The problem is that the menu option in NERDTree copies the file path to the "* register.
This means I can't access the value in the X clipboard.
* Change CWD when switching tabs to the tab's NERDTree root.
* Remove commented-out code.
* List the new possible value for NERDTreeChDirMode in doc.
* Add new option to select between `:cd` and `:tcd`.
* Document the new NERDTreeUseTCD option.
* Update version number in change log.
* Save/Set screen state also on WinLeave and WinEnter.
The particular use case here is when switching tabs with `gt` and the
NERDTrees have been mirrored.
* Update version number and change log.
* Wrap saveScreenState's statements in a try-catch block.
If you're in NERDTree, and you press : to open a command line, and then
press Ctrl+F to open the [Command Line] window, you will see errors
related to switching windows while in this function. (Those commands are
not allowed while in the [Command Line] window.) The try-catch block
handles the errors, preventing their being displayed.
* Update version number in change log.
* If file path doesn't exist, :NERDTreeFind its parent directory instead.
This happens in the following scenario:
```
:edit path/new_file
:NERDTreeFind
```
Instead of an error message about an **invalid path**, this change will
now find the parent directory instead. It will not work if the new file
is **path/new_folder/new_file**, and that's OK because even vim itself
cannot handle both the new folder and the new file; `:w` won't create
the new folder.
* Update version number in change log.
* Change version change from PATCH to MINOR.