Commit Graph

1182 Commits

Author SHA1 Message Date
Phil Runninger (mac)
858b3c0004 Update PR template, moving some text into a comment. 2019-08-09 09:45:46 -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
Phil Runninger
89a1a4355b
When searching for root line num, stop at the end of the file. (#1015)
* When searching for root line num, stop at the end of the file.

When using the following NERDTreeStatusLine, Vim would lock up and not
work anymore. The problem was that when trying to find the root line
number, the loop was continuing past the end of the file, looping
"forever". The fix was to simply stop at the end of the file.

let g:NERDTreeStatusline = "%{exists('g:NERDTreeFileNode')&&" .
      \ "has_key(g:NERDTreeFileNode.GetSelected(),'path')?" .
      \ "g:NERDTreeFileNode.GetSelected().path.getLastPathComponent(0):''}"

* Update change log.
2019-07-04 00:21:50 -04:00
Phil Runninger
62b78de367
Update Change Log 2019-07-03 11:12:21 -04:00
Kebin Liu
aef6baf6e2 Update ui_glue.vim (#1014)
Fix `<CR>` key map on the bookmark
2019-07-03 11:11:25 -04:00
Phil Runninger
06c9d9c963
Make Enter work on the .. ( up a dir ) line (#1013)
* Make Enter work on the `.. ( up a dir )` line.

* Simpler instructions for getting bug info.

* Update changelog.
2019-07-02 15:45:36 -04:00
Phil Runninger
ca16df25fa Fix nerdtree#version() on Windows. 2019-07-01 23:29:56 -04:00
Phil Runninger
cce6fb373f
Expand functionality of <CR> mapping (#1011)
* Define default values for new variables governing new "Default Open".

"Default Open" means to open a file with the Enter key (which of course
can be changed.) The key can be changed in the vimrc, and there is a
variable for specifying the Opener parameters for opening the node. This
lets the user decide whether Enter (or another key) will open a file in
the current tab or a new one, and whether or not to open the file again
in the tab or jump to a window where the file is already open.

* Remove the old mapping for <CR>, a duplicate of 'o'.

<CR> will be defined like all the other keys, in plugin/NERD_tree.vim

* Assign functions to the new <CR> key mapping.

Three separate functions handle directories, files, and bookmarks.

* Rename variables: NERDTreeCustomOpen and NERDTreeCustomOpenArgs

* Add documentation for NERDTreeCustomOpenArgs and NERDTree-<CR>.

* Make key mapping variables be indexed in the Vim help

* Remove angle brackets from <CR> to see if help navigation improves.

* Rename functions from defaultOpen... to customOpen...

* Use separate options for file and directory nodes.

* Update documentation for separate file/directory options.

* Update version number and change log.

* Change CR to <CR> in help tags.

* Fix missing backtick in patch number.

* Update the quickhelp text.

* Update Pull Request template.

* Update change log with simpler formatting of patch number.

* Get NERDTree version number directly from CHANGELOG.md

* Reformat the lists of contributors in the Change Log.

* Initialize the version text, just in case the while loop finds nothing.
2019-07-01 22:13:20 -04:00
Phil Runninger
1c803b36f6
Remove @mentions from PR template and change log. They weren't working. (#1009)
* Remove @mentions from PR template and change log. They weren't working.

* Update version number and change log.
2019-06-27 08:03:50 -04:00
Phil Runninger
2cbc76bbfd
Fix NERDTree opening with the wrong size. (#1008)
* Fix NERDTree opening with the wrong size.

There were two commands that seemed to be causing the NERDTree window to
open in exactly half the screen width. They are:

- silent! execute 'edit ' . t:NERDTreeBufName        in _createTreeWin()
- setlocal nobuflisted                         in _setCommonBufOptions()

These commands were reseting the width of NERDTree. The solution I chose
was to resize the window after creating the new window, and then to set
winfixwidth before setting the other common buffer options.

* Update change log and version number.
2019-06-27 01:34:10 -04:00
Phil Runninger
347a58b0b0
Update Changelog and create PR Template (#1007)
* Update CHANGELOG and change it to Markdown format.

* Add PR template with checklist for advancing the version number.

* Update version number.

* Change PR number in change log and PR template.
2019-06-27 01:28:45 -04:00
Phil Runninger (mac)
33fe2fdf16 Switch to new issue template paradigm, with separate templates. 2019-06-20 08:50:48 -04:00
Phil Runninger
c46fbd21e3
Spacing changes in issue template 2019-06-20 08:17:50 -04:00
Phil Runninger (mac)
b213fae779 Update the issue template. Shout out to @ryanoasis for the inspiration. 2019-06-19 18:38:57 -04:00
Phil Runninger (mac)
b9a421b2d5 Remove the bug.md template. Not able to make multiple templates. 2019-06-19 16:02:55 -04:00
Phil Runninger (mac)
254f7678f3 Move bug.md to its proper folder. 2019-06-19 15:50:35 -04:00
Phil Runninger (mac)
318fb2d0de Add new issue template, just for bugs. 2019-06-19 15:45:22 -04:00
Phil Runninger
9bedadd062
Refresh a dir_node if the file wasn't found in it, and look once more. (#1005) 2019-06-18 10:27:00 -04:00
Phil Runninger
12dea6ccb2
Add a "copy path to clipboard" menu option (#1002)
* Add menu item to copy the node's path to the clipboard.

It works on Mac. Check Windows later.

* Handle case where clipboard is not a compiled feature of Vim.

* Change menu text if clipboard is unavailable.
2019-06-13 09:17:19 -04:00
Phil Runninger
70dc34cb69
Enable root refresh on "vim ." a different way than #999. (#1001)
* Fix "R doesn't work when doing 'vim <folder>'" a different way.

Instead of assigning a value to t:NERDTreeBufName for a window tree,
which is used to determine if NERDTree is open, simply also look at the
current buffer's name to see if it matches the NERDTree pattern.

* Replace hardcoded buffer name prefix with BufNamePrefix() function.
2019-06-13 09:16:56 -04:00
Phil Runninger
28eb47e267
Fix refreshroot (#999)
* Set t:NERDTreeBufName when creating a window tree.

* Change folding markers.
2019-06-07 21:41:47 -04:00
Daniel Manary
67fa9b3116 Change version check to look for 03 not 30 (#994)
My Vim reports as 704 when it is version 7.4, so this number should be 703 not 730
2019-05-09 16:25:36 -04:00
Phil Runninger
a3f0e66793
Change minimum vim (#991)
* Add a new function to implement and() from vim 7.4.

* Change minimum required version of vim to 7.3.
2019-05-09 10:12:25 -04:00
Phil Runninger (mac)
3c06335782 Escape the DirArrow strings in substitute function. 2019-04-23 10:26:30 -04:00
Phil Runninger
9226eab2a8
Allow multi-character DirArrows (#985)
* Add debugging messages to diagnose issue #931.

* Echo the CWD and NERDTree root too.

* Ensure DirArrows are trimmed to a single character.

Actually, it's up to the user to make sure it's a single character after
leading and trailing spaces are removed. Spaces need to be removed so
that an accurate level of indentation can be calculated.

* Remove debugging statements

* Simplify the algorithm for calculating indentation level.

1. Replace the DirArrows with a single space.
2. Count the leading spaces.
3. Divide by 2.

This allows users to specify multi-character arrows, where a spaces
prevent characters printing on top of each other.
2019-04-22 15:58:06 -04:00
Phil Runninger
e126b8745d
Remove redraw! while still clearing last message empty string. (#979) 2019-04-16 09:55:20 -04:00
Phil Runninger (mac)
7513f256aa Fixes #970. Restore silent parameter to _initChildren.
https://github.com/ryanoasis/vim-devicons uses this function directly
with silent set to 1.
2019-03-26 11:57:21 -04:00
Terry Ding
839cddc750 fix _initChildren function value set to numChildrenCached error (#969) 2019-03-26 02:03:12 -04:00
Phil Runninger
e3e600608a
On Windows, do a case-insensitive comparison of paths. (#967) 2019-03-25 22:32:07 -04:00
Phil Runninger
0efbdfbc5a
Remove the "Please wait... DONE" messages. (#966) 2019-03-25 22:29:21 -04:00
Phil Runninger
288669db1f
Smarter delimiter default (#963)
* Better default node delimiter, based on presence of +conceal feature.

* Update documentation for node delimiter.

* Fix IF logic, and remove debug statements.

* Rewrite the NERDTreeNodeDelimiter help text to reflect new behavior.

* Change "NERD tree" to "NERDTree" and fix spacing in doc file.
2019-03-07 08:24:17 -05:00
Spencer
e1916d6fe7 Update directory .vimdc readme example (#961)
* set pwd for new window

* adding 'cd '.argv()[0] explination

* spacing

* exe

* [0]
2019-03-05 11:25:49 -05:00
Chris Patuzzo
84737f2ebe Add a NERDTreeMinimalMenu feature (#938)
* Extract the menu action prompts to a function

* Add a NERDTreeMinimalMenu configuration option

If this option is set, Vim’s command line displays
a single-line version of the menu:

Which action? (a*/m/d/r/o/q/c/l):

Pressing ‘a’ will call the ‘add child node’ menu
item as that is its shortcut.

The * denotes the position of the currently
selected menu item which can be changed with
NERDTreeMenuDown and Up in the usual way.

The user may wish to set these to <left>, <right>
or h, l if they prefer.

* Minimise the text once a menu item is chosen

If NERDTreeMinimalMenu is set, then echo a single
line prompt after the menu item is chosen. This
reduces noise for users who are already familiar
with how the menu works and prevents Vim scrolling
down to accommodate the menu text.

If the directory is non-empty we display
‘Delete directory?’ instead of ‘Delete?’ and the
user must still type ‘yes’ to confirm, rather than
just pressing ‘y’.

* Document the new NERDTreeMinimalMenu feature

* Tweak the format for the minimal menu prompt

As per @PhilRunninger’s suggestions:

- The menu now shows the ‘j/k/enter’ help text
- The first word of the selected item is shown*
- Use commas between menu items so that it’s
  visually distinct from the ‘j/k/enter’ text

* I tried displaying the full menuItem text, but
this can be quite long, e.g.

> (o)pen the current node with system editor

This causes the menu to jump around a lot. We
could add another minimal versions of these, but
I think the first word seems ok for now.
2019-02-24 18:01:12 -05:00
Phil Runninger
b6cde142dd
Preview bookmarks (#956)
* Add function to preview bookmarks.

File bookmarks are previewed like regular file nodes.
Directory bookmarks are located with NERDTreeFind in the current tree.

* Update help doc to include the new bookmark preview functionality.
2019-02-22 08:21:20 -05:00
Phil Runninger
9eda9ce6a1
Add new value to NERDTreeQuitOnOpen to close bookmark table (#955)
* Update documentation for new NERDTreeQuitOnOpen values.

* Modify use of NERDTreeQuitOnOpen, keeping current behavior.

* If applicable, close the bookmarks table before opening the target.
2019-02-21 07:47:15 -05:00
Phil Runninger
2e0b101d57
Add an :EditBookmarks command to edit the bookmarks file (#954)
* Add a new NERDTree buffer command to edit the bookmarks file.

* Update the mini-help panel with missing bookmark commands.

* Update the help file with the new :EditBookmarks command.
2019-02-20 23:57:51 -05:00
Phil Runninger (mac)
f4d2b301b7 Merge branch 'master' of github.com:scrooloose/nerdtree 2019-02-18 15:53:39 -05:00
Phil Runninger (mac)
4ef9967e29 Update the documentation to better explain the delimiter character. 2019-02-18 15:52:23 -05:00
Phil Runninger
842f5cabaa Before deleting, turn off &shellslash. Restore after delete is done. 2019-02-17 22:03:49 -05:00
Phil Runninger
cce52fb9c5
Before copying, turn off &shellslash. Restore after copy is finished. (#952) 2019-02-17 18:30:10 -05:00
Phil Runninger
c05615fd80
Set a maximum window size when zooming. (#950) 2019-02-15 03:10:28 -05:00
Phil Runninger
5e8aa9e721
Confirm the wipeout of a unsaved buffer whose file has been renamed. (#949) 2019-02-14 17:44:31 -05:00
Phil Runninger
74be22deb7
Escape a backslash so it can be used in a key mapping. (#948) 2019-02-14 15:28:30 -05:00
zcodes
8cc154d4b0 fixed root path error for windows (#935)
* fixed root path error for windows

* simplify condition check
2019-02-01 07:50:55 -05:00
Phil Runninger
72c3656799
Add new command to open NERDTree in the root of a VCS repository. (#872)
* Add new command to open NERDTree in the root of a VCS repository.

* Add another example to the help file.

* Refactor and make NERDTreeVCS work on Windows.

* Don't crash when NERDTreeVCS is given a nonexistent folder.

* Move VCS code to a plugin script.

* Add some documentation to the top of vcs.vim.
2018-12-12 13:30:13 -05:00