Commit Graph

76 Commits

Author SHA1 Message Date
Phil Runninger
14af89743a
Open a mirrored NERDTree with correct width (#1177)
* Make sure a mirrored NERDTree is displayed at correct width.

* Remove references to unused variables.

b:NERDTreeOldWindowSize was referenced, but never set anywhere. No need
to keep it around.

* Refactor: Initialize variables a different way.

Using the get() function allows us to "let" variables more directly,
without using the execute command or requiring strings to be escaped.
This also eliminates the s:initVariable function. The new format is
shown below, and defines a default value if the user didn't provide a
value in the vimrc file.

  let g:var = get(g: 'var', 'default value')

* Update version number in change log.

* Fix alignment of `let g:var = get(g:, 'var', <default>)` statements.
2020-10-14 18:08:18 -04:00
Yosef Herskovitz
577ddc73f0
Updated Readme (#1167)
* Updated Readme

Fixed typo in readme

* Updated Changelog
2020-08-18 11:14:05 -04:00
Phil Runninger
23000acd7f
Refactor sort comparison functions, removing redundancy (#1166)
* Add a function to compare path objects.

* Remove redundant node comparison function, and rename the ones left.

* Remove the compareTo function in the Path object.

Use nerdtree#compareNodePaths(p1,p2) instead. There was no need for two
comparison functions that do the same thing. They were a little
different in their details, but that shouldn't be the case. Having only
one such function makes better sense and is easier to maintain.

* Update version number in change log.
2020-08-14 18:06:03 -04:00
Phil Runninger
6b5d70e5bf
Fix argument of exists() function calls checking for autocommands. (#1165)
* Fix syntax of exists function calls checking for autocommands.

* Update version number in change log.
2020-08-09 07:07:55 -04:00
Phil Runninger
373a4b28e4
Don't use silent when raising User events (#1164)
* Remove silent from doautocmd. Prevent errors with exists('#...').

* Update version number in change log.
2020-08-07 00:37:56 -04:00
Yeri Pratama
4a32dd0be3
fix highlight for file node (#1157)
* fix #960 953 highlight for file node

* update changelog
2020-07-24 11:14:54 -04:00
Phil Runninger
e571d3e95b
Make sure symbolic links' flags are highlighted correctly. (#1156)
* Make sure symbolic links' flags are higlighted correctly.

* Update version number in change log.
2020-07-17 14:11:08 -04:00
Phil Runninger
96e247ba74
Respect user's &shellslash setting in CopyNode and RemoveNode functions (#1150)
* Replace s:Path.Slash() with nerdtree#slash().

* Check the value of &shell when determining the slash under Windows.

* Leave &shellslash unchanged when forming copy/delete commands.

* Fix fold marker.

* Update version number in change log.

* Add abort attribute to nerdtree#slash() to satisfy Vim style guide.

Co-authored-by: Phil Runninger <prunninger@vhtcx.com>
2020-07-14 08:53:00 -04:00
Phil Runninger
f8aa749985
Fix new NERDTrees' width when previous one was in the only window. (#1153)
* Fix new NERDTrees' width when previous one was in the only window.

When leaving a NERDTree buffer, its window's width is remembered so that
that width can be used when showing the buffer again in a new window. If
NERDTree is the only window when leaving the buffer, it remembers the
whole width of the editor. When a new NERDTree window is created, it is
sized such that there is only a very small window for files to be opened
into.

To fix this, if NERDTree is the ONLY window, remember its width as the
value of g:NERDTreeWinSize, not the width of the editor.

* Update version number in change log.
2020-07-14 07:20:48 -04:00
Phil Runninger
aa37cb40da
Fix the scope of several key mappings (#1151)
* Limit opening or previewing into a split window to only file nodes.

* Prevent previwing directory nodes, which would create another NERDTree.

* Refactor the previewBookmark code to open directories a better way.

* Update version number in change log.

* Update documentation.
2020-07-12 10:03:24 -04:00
Phil Runninger
6571452857
Enable opening bookmarks in split windows. (#1144)
* Add open/preview in split/vsplit to bookmarks.

* Make preview split/vsplit bookmark work only on file nodes.

* Add quickhelp text for split/vsplit commands on bookmarks.

* Handle previewing directory bookmarks properly.

* Update documentation: bookmarks can be opened in a split/vsplit.

* Update version number in change log.
2020-06-23 10:40:30 -04:00
Phil Runninger
9de5b3e785
Allow concealed characters to show another character. (#1138)
* Closes #1136. Allow concealed characters to show another character.

conceallevel=3 always hides the character, but conceallevel=2 allows an
alternate character to be displayed instead.

* Update version number in changelog.
2020-06-01 02:08:13 -04:00
Phil Runninger
052b1f00a0
Add curly braces to the list of characters to be escaped. (#1128)
* Add curly braces to the list of characters to be escaped.

* Update version number in change log.
2020-05-26 00:15:17 -04:00
Phil Runninger
f63132cade
Use backward-compatible nerdtree#and() in one place that was missed. (#1134)
* Use backward-compatible nerdtree#and() in one place that was missed.

* Update version number in change log.
2020-05-25 11:33:20 -04:00
Phil Runninger
484dc84b47 Update title of pull request. Add PR authors where missing. 2020-05-22 09:02:39 -04:00
Jordi Altayó
2e9d43b6f8
cmd.exe /c start "" <filename> for windows default viewer support (#1130)
* support for default viewer in Windows

* updated changelog

* Update nerdtree_plugin/fs_menu.vim

Co-authored-by: Phil Runninger <PhilRunninger@users.noreply.github.com>

* Update nerdtree_plugin/fs_menu.vim

Co-authored-by: Phil Runninger <PhilRunninger@users.noreply.github.com>

Co-authored-by: Phil Runninger <PhilRunninger@users.noreply.github.com>
2020-05-22 08:57:19 -04:00
Eugenij
10eaa3a2f4
Fixed a bug that caused the file-tree construction to slow down significantly. (#1126)
Co-authored-by: evgenij.vidershpan <evgenij.vidershpan@yandex.ru>
2020-05-21 02:23:35 -04:00
Eugenij
e2670f0d19
* fix duplicated slash in s:Path.isUnder() (on windows OS) (#1122)
* * fix duplicated slash in s:Path.isUnder() (on windows OS, for root directory on drive Path.str() return path with [back]slash)

* * Rewrite NERDTreePath.isUnder() and NERDTreePath.isAncestor() for direct comparison of paths without transformations

* Remove trailing slash, so we don't end up with two on root folder.

The str() function returns "C:\" on the root folder and "C:\temp" on
non-root folders, one with and one without a trailing backslash. This
inconsistency needs to be handled so the stridx() function will work
correctly.

* Make sure the change also works in a non-windows file system.

This commit handles an edge case that can be triggered with these
commands:
    :cd /home/me
    :e /foobar.txt  (an existing file)
    :NERDTreeFind
What happened was the root directory name '/' was being Resolved(), and
the trailing (and only) slash was being removed. The NERDTree was then
created in the current working directory, instead of the root directory.
:NERDTreeFind then wasn't able to find foobar.txt, and printed an error.

* Remove degugging statements.

* * ambiguity issue fix

Co-authored-by: Phil Runninger <philrunninger@gmail.com>
2020-05-14 14:24:36 -04:00
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