Commit Graph

58 Commits

Author SHA1 Message Date
lifecrisis
4cc6097ecb
Do not consider the tree root to be "cascadable" (#1120)
* Do not consider the tree root to be "cascadable"

* Update "CHANGELOG.md"
2020-05-06 23:24:01 -04:00
Phil Runninger
3005a0e9c0 Update version number in change log. 2020-05-04 08:11:49 -04:00
Phil Runninger
5e77fb2fef
Fix example code for the NERDTreeAddKeyMap function. (#1116)
* 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.
2020-05-03 01:21:34 -04:00
Phil Runninger
29a321d061
Put '%' argument in bufname() for backwards compatibility. (#1105)
* Put '%' argument in bufname() for backwards compatibility.

* Update version number in change log.
2020-04-15 08:58:07 -04:00
Phil Runninger
0257d64248
If a file's already open in the window, don't edit it again. (#1103)
* If a file's already open in the window, don't edit it again.

* Update version number in change log.

* Make only one call to self.str().
2020-04-15 00:55:13 -04:00
Phil Runninger
2d7cb043d4
Prevent unneeded tree creation in :NERDTreeToggle[VCS] <path> (#1101)
* 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.
2020-04-13 17:05:27 -04:00
lifecrisis
f767dd34a0
Add missing calls to the shellescape() function (#1099)
* 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...
2020-04-09 21:37:55 -04:00
Rolando
832bbaa729
Fix vsplit to not open empty buffer (#1098)
* Fix vsplit to not open empty buffer

* Add changelog entry
2020-04-01 01:21:37 -04:00
Eugenij
343508e9fd
Fix infinity loop in FindParentVCSRoot (#1095)
* 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>
2020-03-26 16:33:11 -04:00
Phil Runninger
495b4e781a
File Move: Escape existing directory name when looking for open files. (#1094)
* 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>
2020-03-24 15:08:06 -04:00
Bouke van der Bijl
09b165cfac Add changelog entry 2020-02-20 10:49:03 +01:00
Phil Runninger
07612557eb Give kazukazuinaina proper credit. 2020-02-07 14:11:00 -05:00
kazukazuinaina
41a44be8d5 [add] How to install using dein.vim
update changelog
2020-02-08 03:45:28 +09:00
Phil Runninger
1f5018dc45 Update version number in change log. 2020-02-06 17:43:46 -05:00
Phil Runninger
b16553ac54 Update pull request number in change log. 2020-01-28 03:57:50 -05:00
Phil Runninger
e48b5728f9 NERDTree <start-directory> always sets NERDTree root. 2020-01-28 03:55:58 -05:00
Phil Runninger
f7b09634ba Fix typo in version number. 2020-01-28 03:20:07 -05:00
andys8
881c265438 [BUGFIX] Shows error for empty filenames (vim-startify)
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
2020-01-20 15:05:47 +01:00
Phil Runninger
6d5e185cef Update version in change log. 2020-01-16 13:25:57 -05:00
Phil Runninger
a046ba5c5b Update version number in change log. 2020-01-15 19:54:06 -05:00
Phil Runninger
b579c7751d Fix regex that finds keyword for minimal menu. 2020-01-06 09:19:25 -05:00
Phil Runninger
8a14891241
Merge pull request #1072 from preservim/migrate
Update links to repository with new org namespace
2020-01-02 09:55:17 -05:00
Caleb Maclennan
914970157f
Update links to repository with new org namespace 2020-01-02 12:09:02 +03:00
Caleb Maclennan
3fb31b2e81 Update changelog for 6.4.2 and add CI badge 2019-12-31 10:30:00 +03:00
Phil Runninger
1ab85e33be Update version in change log. 2019-12-16 09:06:45 -05:00
Alejandro Sanchez
a7886fb6c4 Allow use of function references as callbacks (#1067) 2019-12-14 20:25:17 -05:00
William Findlay
82b1649f2e Add a NERDTreeToggleVCS command to the vcs plugin (#1060)
* NERDTreeToggleVCS

* nerdtree toggle vcs documentation

* fix function documentation

* changelog

* Update CHANGELOG.md

* Update CHANGELOG.md

* simplify toggletreevcs

* Update CHANGELOG.md
2019-11-22 11:26:25 -05:00
Phil Runninger
8d9b8dae67
Update version number in changelog. 2019-11-13 09:00:41 -05:00
Phil Runninger
371feb7e54
Support tab-specific CWDs (#1032)
* 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.
2019-10-16 13:26:20 -04:00
Farid Ahmadian
4245517689 Add VIM built-in package management to readme (#1049) 2019-10-14 09:13:20 -04:00
Phil Runninger
926ff0ec03 Update version number instructions in PR template and change log. 2019-10-11 10:44:25 -04:00
Phil Runninger
53eef21ad6
Save/Set screen state also on WinLeave and WinEnter. (#1048)
* 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.
2019-10-11 01:04:06 -04:00
Phil Runninger
4fe24d3156
Wrap saveScreenState's statements in a try-catch block. (#1047)
* 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.
2019-10-08 14:01:50 -04:00
Phil Runninger
2d639b70e7
Catch errors when trying to read CHANGELOG.md. (#1045)
* Catch errors when trying to read CHANGELOG.md.

The ArchLinux package
(https://www.archlinux.org/packages/community/any/vim-nerdtree/) puts
this file in the wrong location.

* Update version number in change log.
2019-10-01 09:17:32 -04:00
Phil Runninger
6318406f66
If file path doesn't exist, :NERDTreeFind its parent directory instead. (#1043)
* 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.
2019-09-29 11:28:59 -04:00
Phil Runninger
496b61ead1 Give @dragonxlwang proper credit on PR #1035. 2019-09-26 08:48:57 -04:00
Phil Runninger
5af6859846
Reintroduce necessary variable mistakenly removed. (#1040)
* Reintroduce lost variable: splitMode.

* Add a space between splitMode and "split". `verticalsplit` is invalid.

* Update version number, and add attributions (PR authors)
2019-09-26 08:47:36 -04:00
Phil Runninger
bd744eab8d
Make the behavior of window splits consistent (#1035)
* 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.
2019-09-24 01:19:27 -04:00
Phil Runninger
9193962ad8 Update version number in change log. 2019-09-15 14:44:09 -04:00
Phil Runninger
60ec10b477
Enable events when closing NerdTree window. (#1037)
* Enable events when closing NT window. Triggers updates in Airline.

* Update version number in change log.
2019-09-13 10:49:26 -04:00
Phil Runninger (mac)
51fc75efdb Fix version number. I was on the wrong branch. 2019-09-09 09:40:18 -04:00
Phil Runninger (mac)
79ef87b009 Update version number in change log. 2019-09-09 05:27:48 -04:00
Phil Runninger
3d508aedce
Fix the e key mapping to use netrw if desired (#1031)
* 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.
2019-08-27 20:53:23 -04:00
Phil Runninger
c4a7ca084e
Add file extension and size to sorting capabilities (#1029)
* 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.
2019-08-19 03:51:34 -04:00
Phil Runninger
ae1c0004ec
Suppress events for intermediate window/tab/buffer changes (#1026)
* 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.
2019-08-08 22:00:35 -04:00
Phil Runninger
63c59208c1
Revert #1019 to fix nvim artifacts and flickering. (#1021)
* 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.
2019-07-14 15:17:56 -04:00
Phil Runninger
4ac07f52a3
Use :mode only in neovim. MacVim still needs to use :redraw! (#1019)
* 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.
2019-07-10 09:45:58 -04:00
Phil Runninger (mac)
2f0d48d632 Update version in change log. 2019-07-07 03:53:06 -04:00
Phil Runninger
a460d6ef7f
In CHANGELOG.md and PR template, make reference to PR a true HTML link. (#1017) 2019-07-07 03:50:59 -04:00
Phil Runninger
3b1a850b85
Use :mode instead of :redraw! when updating menu. (#1016)
* 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.
2019-07-07 03:19:17 -04:00