* Fix example code for the NERDTreeAddKeyMap function.
The quickhelpText didn't match what the statement in the callback
function actually did.
* Update version number in change log.
* Don't recreate the NERDTree if its root is the same as being requested.
* Use single quotes per Vint's style recommendation.
* Update version number in changelog.
* Use a simpler method of getting the NERDTree root path.
* Remove variable. Just compare agains the function call's result.
* Improve "g:NERDTreeQuickLook()"
The following improvements were made...
- Use variable sigils
- Shorten a local variable name
- Prefer an early return over testing for a negative
- Switch to single quotes
- Call "shellescape()" to pass a command argument [IMPORTANT!]
The final change is a critical fix for the security and reliability
of this function (see ":h system()").
Similar fixes for the other functions in this script will follow.
* Improve "g:NERDTreeRevealInFinder()"
This commit makes several style improvements and adds a missing call
to the "shellescape()" function.
See also: 56cfbcff1e
* Improve "g:NERDTreeExecuteFile()"
Refer to: 56cfbcff1e
* Improve "g:NERDTreeRevealFileLinux()"
Refer to: 56cfbcff1e
* Improve "g:NERDTreeExecuteFileLinux()"
Refer to: 56cfbcff1e
* Properly reveal "/" on Linux
This commit handles the edge case where a user invokes the "reveal"
function on "/" on a Linux box. There is nothing to do but open the
root directory itself since "/" has no parent.
* Update the "CHANGELOG.md" file
* Add final missing "shellescape()" calls
I initially thought that there were several more locations where
a call to "shellescape()" was required but omitted. However, there
are only two. I suppose I should have taken the time to look.
Fixing these was easy. I would be surprised if this change breaks
anything on the user side.
* Update the "CHANGELOG.md" file (again)
Use a more fitting description of the change...
* Fix infinity loop in FindParentVCSRoot (on windows os with 'set shellslash' in vimrc and no VCS in path)
* update CHANGELOG.md
* Update CHANGELOG.md
Co-Authored-By: Phil Runninger <PhilRunninger@users.noreply.github.com>
Co-authored-by: evgenij.vidershpan <evgenij.vidershpan@yandex.ru>
Co-authored-by: Phil Runninger <PhilRunninger@users.noreply.github.com>
* File Move: Escape existing directory name when looking for open files.
* Update version number in change log.
Co-authored-by: Phil Runninger <prunninger@vhtcx.com>
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
* 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.
* 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.
* Add an optional parameter to neredtree#exec to suppress all events.
The value doesn't matter, but 1 is a good choice. Its presence is an
indicator that tells NERDTree to tell Vim to ignore all events. I'm not
yet sure if there needs to be an else section to that if block. It may
be OK to allow all events to fire in the right situations.
* Supress events in all intermediate nerdtree#exec calls.
Finding all the right function calls is the key here.
* Make ignoreAll a required parameter to nerdtree#exec().
* Put required ignoreAll argument (==0) in where it's now needed.
* Ignore events when creating a new vertical split.
* Ignore events when closing NERDTree. This may need to be reverted.
* Remove debugging statment and commented-out code.
* Wrap remaining buffer/window-switching commands in nerdtree#exec().
* Update version number.
* Add a space between arguments in nerdtree#exec() calls.
* Revert "Use :mode only in neovim. MacVim still needs to use :redraw! (#1019)"
This reverts commit 4ac07f52a3.
* If not Neovim, use `:redraw!` as was done before.
* Update version number.
* Fix punctuation in NERDTree Menu instructions.
* Use :mode only in neovim. MacVim still needs to use :redraw!
* Make nerdtree#redraw do both redraw and redraw! based on a parameter.
* Make bang a required parameter.
* Replace all redraw statments with call nerdtree#redraw function calls.
* Update version in change log.
* Use :mode instead of :redraw! when updating screen.
In neovim, it will actually clear the whole screen, whereas, redraw!
does not.
* Update version number in change log.