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.
* Reintroduce lost variable: splitMode.
* Add a space between splitMode and "split". `verticalsplit` is invalid.
* Update version number, and add attributions (PR authors)
* add option to spawn split from previous window
* Update some comments and remove debugging statement.
* Simplify the code, and make it respect NERDTreeWinPos and 'splitbelow'.
* Better logic for getting NERDTree window number when not active window.
* Use common functions for splitting windows. Make splitting respect user.
The placement of split windows now respects the user's choices for the
splitright and splitbelow settings, and the g:NERDTreeWinPos variable.
* Update version number in change log.
The ‘copy (p)ath to clipboard’ menu item was added
recently in this pull request:
https://github.com/scrooloose/nerdtree/pull/1002/files
However, this caused the NERDTreeMinimalMenu to
display ‘copy’ instead of ‘(p)ath’ because it was
simply using the first word of the item’s text.
This change fixes that bug by using a regex to
pick out the first word beginning with ‘(’
* Use :edit in openExplorer to allow NERDTreeHijackNetrw to do its thing.
* Remove commented-out code.
* Make `e` work on file nodes, opening a new NERDTree or netrw buffer.
* Update change log.
* Add ability to sort by extension and file size.
Use the tags [[extension]], [[size]], or [[-size]] in the
g:NERDTreeSortOrder list to accomplish this sorting.
* Prevent metadata tags being misused in getSortOrderIndex().
* Apply metadata tags only to files.
* Update NERDTreeSortOrder in help file.
* Update version number in CHANGELOG.