* 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.
* 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.
* 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.
* Update documentation for new NERDTreeQuitOnOpen values.
* Modify use of NERDTreeQuitOnOpen, keeping current behavior.
* If applicable, close the bookmarks table before opening the target.
* 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.
* 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.
This function was added to support a separate plugin:
https://github.com/scrooloose/nerdtree-project-plugin.git. It was
subsequently removed without recognizing its contribution to the
external plugin. This commit restores that function so NERDTree projects
will work.
* Change the default node delimiter to the BELL character, \x07.
* Syntax match by ASCII code, vs. string concatenation.
* Document the NERDTreeNodeDelimiter setting.
* Clean up the documentation markup.
* Remove apostrophes, since the NERDTree settings aren't vim options.
* Use backticks to hot-link the referenced vim options.
* Add a modeline.
* Update the title and the About section of the documentation.
* Fix typo, and clarify branches of code in Github.
* Fix wrapping to 78, and remove colorcolumn setting from modeline.
* Change the ASCI Art title, and give credit for it.
* Change the word option to setting, and redo the word wrapping.
I want to reserve the word 'option' to mean only Vim options that are
changed with the `:set` command. Since we need to use `:let` to
establish the values for the NERDTree variables, I choose to call them
settings instead.
* Realign hot-links with concealed markup tags taken into account.
* Text alignment, typo fixes, and wordsmithing the About section.
* Add two more disqualifications for isCascadable().
A directory that is bookmarked or that is a symlink to another location
has trailing text indicating so. This extra text causes problem when
cascading with a directory underneath it, so disable it in this case.
* Add comments to explain the new exclusions for bookmarks and symlinks.
* Use a delimiter in node to separate file/dir name from the rest.
* Switch warning message to use nerdtree#deprecated function.
* Compress the space between the tree symbols and the node.
* Include the delimiter when calculating indent or getting filename.
* Don't need to strip leading delimiter. It will already be gone.
* Simplify the way the delimiter is being used.
I don't know what I was thinking. The delimiter doesn't need to be used
to separate every indicator on the node's text, ie.
Bad: Tree|GenericFlags|Filename|ExecutableFlag|Link|ReadonlyFlag
Better: Tree GenericFlags|Filename|ExecutableFlag Link ReadonlyFlag
This was unnecessary, given that we're only interested in the filename.
So, just one pair of delimiters is all we need. That greatly simplifies
the _stripMarkup function, and restores a bunch of other statements to
what they already are in the master branch.
* Add syntax highlighting to conceal the delimiter
* Put a if has("conceal") check around the syntax statement using it.
* Make concealment work correctly for LinkFile and readonly files.
* Use highlight Ignore if conceal isn't available.
This is probably the best we can do, especially if some other character
must be used in place of nbsp.
* Make the regex better match the original, but more compact.
It was allowing 2+ spaces, instead of only 1+.
* Fix the syntax highlighing of delimiters around NERDTreeExecFile.
* Bug fix: Parse . and .. from path string with trailing slash.
* Fix unresponsive cascaded directories.
Using ':' as a more visible delimiter, when directories are cascaded,
the line appears in NERDTree like so:
▾ :lib/::nerdtree/:
Before this commit, the s:UI._stripMarkup function was leaving the
internal delimiters in place (lib/::nerdtree/). Now they are removed,
resulting in a valid path (lib/nerdtree/).
* Use .= to shorten statement. Use clearer substitutes to get node name.
* Remove node delimiters that terminate the line.
* If flags are needed after the node name, then put another delimiter
before them.
* When joining directory nodes for cascaded display, strip off the
delimiter from the child node(s).
* Remove the unnecessary substitution of doubled intermediate
delimiters, since they're not in there anymore.
* DRY up the addition of the 2nd delimiter, and use only 1 for all tags.
* WIP: Wow! That's an ugly diff. I'm not done yet, though.
* Fix the ugliness of the previous commit, and finish the work.
If the node being renamed is a directory, get a list of all open buffers
whose file lives in the old directory. If that list is not empty, ask
the user if he wants to replace the old buffers with the new files. The
logic to handle renaming a file node stays the same, although the code
has been refactored a bit.
* Introduce a flag to to sort by the node's modification time.
This flag is part of the NERDTreeSortOrder list. '[[timestamp]]' sorts
oldest to newest, while '[[-timestamp]]' sorts newest to oldest. Its
position in the array determines whether it is the primary sort (first
position) or secondary sort (any other position). The remaining elements
in the array describe the other sort level following all prior rules. If
needed, a tertiary sort is done alphabetically on the filename.
Examples:
['[[timestamp]]'] - oldest to newest
['\/$','*','[[-timestamp]]'] - dirs, then files, each newest first.
When using this flag, performance is slowed a little because the sortKey
is always recalculated with every sort. Why? Because if a file is saved
(either in vim or by an outside program), NERDTree needs to go back out
to the shell to get the new modification time.
* Update NERDTreeSortOrder documentation.
The new `[[timestamp]]' and '[[-timestamp]]' flags are added to support
sorting by modification time.
* Fix the inequality. Must be >= to force recalculation of _sortKey.
* Move `let path=` closer to where it's used.
When :NERDTreeFind creates a tree, it resolves the file's path, and
makes that its root. See :h resolve() for more info; it basically
tracks down links to their ultimate source. Then :NERDTreeFind
tries to find the file under that root, so it can be revealed. The
problem is that it compares the file's unresolved path against the
resolved path in the root. Here is the scenario:
/tmp/ is a link to /private/tmp/
:e /tmp/foo will open the file as expected
:NERDTreeFind will first create a tree with a root of /private/tmp/
Then it tries to find /tmp/foo, but it can't, because the path
names don't match.
This commit resolves /tmp/foo to the actual location of
/private/tmp/foo; thus, it is able to find the file in the tree.
* Force sort to recalculate the cached sortKey.
The problem in issue #880 was caused by the sort using the old sortKey.
For example, given nodes A, B, and C, if B were renamed to D, the sort
was still using B as its sortKey, thus not moving it.
It's a bit of a hack, but if we set g:NERDTreeOldSortOrder to an empty
list, the cached sortKey will be recalculated. I did the same thing for
both the Copy and Add functions as well.
* Add a comment to explain the let ... = [] statement.
When middle-clicking, the s:TreeFileNode.GetSelected() function is
called along the way. If this is done outside of the NERDTree window,
there is not "b:NERDTree" variable, and the "E121: Undefined variable"
exception is thrown. This function was trying to catch only the NERDTree
specific errors; thus, it let the Undefined variable exception slip by.
This commit causes the function to catch all errors.
* Use a better arg for FINDSTR when using the m,l command in Windows.
* Remove trailing spaces.
* Use vim getf...() functions in place of DOS commands.
* Remove unnecessary variable.
* Put labels in the text of the file/dir listing.
This PR is a rewrite of the "s:UI.getLineNum()" function. This change
improves the logic and clarity of this function, and it fixes the function's
ability to work with cascades.
Fixes#529.