mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6318406f66 | ||
|
|
496b61ead1 | ||
|
|
5af6859846 | ||
|
|
bd744eab8d | ||
|
|
9193962ad8 | ||
|
|
2eaedd8bf4 | ||
|
|
60ec10b477 | ||
|
|
51fc75efdb | ||
|
|
79ef87b009 | ||
|
|
3d508aedce | ||
|
|
9afab6257b | ||
|
|
877f41e243 | ||
|
|
c4a7ca084e | ||
|
|
184fbb6ffe | ||
|
|
03073bb1c8 | ||
|
|
858b3c0004 | ||
|
|
ae1c0004ec | ||
|
|
63c59208c1 | ||
|
|
4ac07f52a3 | ||
|
|
2f0d48d632 | ||
|
|
a460d6ef7f | ||
|
|
3b1a850b85 |
16
.github/ISSUE_TEMPLATE/bug.md
vendored
16
.github/ISSUE_TEMPLATE/bug.md
vendored
@@ -3,18 +3,18 @@ name: "Bug Report"
|
|||||||
about: "NERDTree is misbehaving? Tell us about it."
|
about: "NERDTree is misbehaving? Tell us about it."
|
||||||
labels: bug
|
labels: bug
|
||||||
---
|
---
|
||||||
|
<!-- Attention! Please Read!
|
||||||
|
|
||||||
# Attention! Please Read!
|
Please fill out ALL the information below so that the issue can be fully
|
||||||
|
understood. Omitting information will delay the resolution of your issue. It
|
||||||
|
will be labeled "Needs More Info", and may be closed until there is enough
|
||||||
|
information.
|
||||||
|
|
||||||
Please fill out **ALL the information** below so that the issue can be fully understood. Omitting information will delay the resolution of your issue. It will be labeled **`Needs More Info`**, and *may* be closed until there is enough information.
|
Keep in mind that others may have the same question in the future. The better
|
||||||
|
your information, the more likely they'll be able to help themselves. -->
|
||||||
Keep in mind that others may have the same question in the future. The better your information, the more likely they'll be able to help themselves.
|
|
||||||
|
|
||||||
After reading, and before submitting your issue, please remove this introductory text.
|
|
||||||
|
|
||||||
──────────────────── ✄ ────────────────────
|
|
||||||
|
|
||||||
#### Self-Diagnosis
|
#### Self-Diagnosis
|
||||||
|
<!-- Check the boxes after creating the issue, or use [x]. -->
|
||||||
- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question.
|
- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question.
|
||||||
- [ ] I have reviewed the NERDTree documentation. `:h NERDTree`
|
- [ ] I have reviewed the NERDTree documentation. `:h NERDTree`
|
||||||
- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki).
|
- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki).
|
||||||
|
|||||||
16
.github/ISSUE_TEMPLATE/question.md
vendored
16
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -3,18 +3,18 @@ name: "General Question"
|
|||||||
about: "Having trouble setting up NERDTree? Need clarification on a setting? Ask your question here."
|
about: "Having trouble setting up NERDTree? Need clarification on a setting? Ask your question here."
|
||||||
labels: "general question"
|
labels: "general question"
|
||||||
---
|
---
|
||||||
|
<!-- Attention! Please Read!
|
||||||
|
|
||||||
# Attention! Please Read!
|
Please fill out ALL the information below so that the issue can be fully
|
||||||
|
understood. Omitting information will delay the resolution of your issue. It
|
||||||
|
will be labeled "Needs More Info", and may be closed until there is enough
|
||||||
|
information.
|
||||||
|
|
||||||
Please fill out **ALL the information** below so that the issue can be fully understood. Omitting information will delay the resolution of your issue. It will be labeled **`Needs More Info`**, and *may* be closed until there is enough information.
|
Keep in mind that others may have the same question in the future. The better
|
||||||
|
your information, the more likely they'll be able to help themselves. -->
|
||||||
Keep in mind that others may have the same question in the future. The better your information, the more likely they'll be able to help themselves.
|
|
||||||
|
|
||||||
After reading, and before submitting your issue, please remove this introductory text.
|
|
||||||
|
|
||||||
──────────────────── ✄ ────────────────────
|
|
||||||
|
|
||||||
#### Self-Diagnosis
|
#### Self-Diagnosis
|
||||||
|
<!-- Check the boxes after creating the issue, or use [x]. -->
|
||||||
- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question.
|
- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question.
|
||||||
- [ ] I have reviewed the NERDTree documentation. `:h NERDTree`
|
- [ ] I have reviewed the NERDTree documentation. `:h NERDTree`
|
||||||
- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki).
|
- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki).
|
||||||
|
|||||||
11
.github/PULL_REQUEST_TEMPLATE.md
vendored
11
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -9,12 +9,5 @@ Closes # <!-- Issue number this PR addresses. If none, remove this line. -->
|
|||||||
- [ ] `MAJOR` version when you make incompatible API changes
|
- [ ] `MAJOR` version when you make incompatible API changes
|
||||||
- [ ] `MINOR` version when you add functionality in a backwards-compatible manner
|
- [ ] `MINOR` version when you add functionality in a backwards-compatible manner
|
||||||
- [ ] `PATCH` version when you make backwards-compatible bug fixes
|
- [ ] `PATCH` version when you make backwards-compatible bug fixes
|
||||||
- [ ] Update [CHANGELOG.md](https://github.com/scrooloose/nerdtree/blob/master/CHANGELOG.md), following this format/example:
|
- [ ] Update [CHANGELOG.md](https://github.com/scrooloose/nerdtree/blob/master/CHANGELOG.md), following the established pattern.
|
||||||
```
|
- [ ] Tag the merge commit, e.g. `git tag -a 3.1.4 -m "v3.1.4" && git push origin --tags`
|
||||||
#### MAJOR.MINOR...
|
|
||||||
- **.PATCH**: PR Title (Author) #PR Number
|
|
||||||
|
|
||||||
#### 5.1...
|
|
||||||
- **.1**: Update Changelog and create PR Template (PhilRunninger) #1007
|
|
||||||
- **.0**: Too many changes for one patch...
|
|
||||||
```
|
|
||||||
|
|||||||
247
CHANGELOG.md
247
CHANGELOG.md
@@ -1,129 +1,144 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
#### 6.1...
|
||||||
|
- **.0**: If file path doesn't exist, :NERDTreeFind its parent directory instead. (PhilRunninger) [#1043](https://github.com/scrooloose/nerdtree/pull/1043)
|
||||||
|
#### 6.0...
|
||||||
|
- **.1**: Reintroduce necessary variable mistakenly removed. (PhilRunninger) [#1040](https://github.com/scrooloose/nerdtree/pull/1040)
|
||||||
|
- **.0**: Make the behavior of window splits consistent (dragonxlwang, PhilRunninger) [#1035](https://github.com/scrooloose/nerdtree/pull/1035)
|
||||||
|
#### 5.3...
|
||||||
|
- **.3**: Fix (p)ath not displaying in the minimal menu (tuzz) [#1038](https://github.com/scrooloose/nerdtree/pull/1038)
|
||||||
|
- **.2**: Enable events when closing NerdTree window. (PhilRunninger) [#1037](https://github.com/scrooloose/nerdtree/pull/1037)
|
||||||
|
- **.1**: Fix the `e` key mapping to use netrw if desired (PhilRunninger) [#1031](https://github.com/scrooloose/nerdtree/pull/1031)
|
||||||
|
- **.0**: Add file extension and size to sorting capabilities (PhilRunninger) [#1029](https://github.com/scrooloose/nerdtree/pull/1029)
|
||||||
#### 5.2...
|
#### 5.2...
|
||||||
- **.4**: When searching for root line num, stop at end of file. (PhilRunninger) #1015
|
- **.9**: Suppress events for intermediate window/tab/buffer changes (PhilRunninger) [#1026](https://github.com/scrooloose/nerdtree/pull/1026)
|
||||||
- **.3**: Fix `<CR>` key map on the bookmark (lkebin) #1014
|
- **.8**: Revert [#1019](https://github.com/scrooloose/nerdtree/pull/1019) to fix nvim artifacts and flickering. (PhilRunninger) [#1021](https://github.com/scrooloose/nerdtree/pull/1021)
|
||||||
- **.2**: Make Enter work on the `.. ( up a dir )` line (PhilRunninger) #1013
|
- **.7**: Use :mode only in neovim. MacVim still needs to use :redraw! (PhilRunninger) [#1019](https://github.com/scrooloose/nerdtree/pull/1019)
|
||||||
- **.1**: Fix nerdtree#version() on Windows. (PhilRunninger) N/A
|
- **.6**: In CHANGELOG.md and PR template, make reference to PR a true HTML link. (PhilRunninger) [#1017](https://github.com/scrooloose/nerdtree/pull/1017)
|
||||||
- **.0**: Expand functionality of `<CR>` mapping. (PhilRunninger) #1011
|
- **.5**: Use `:mode` instead of `:redraw!` when updating menu. (PhilRunninger) [#1016](https://github.com/scrooloose/nerdtree/pull/1016)
|
||||||
|
- **.4**: When searching for root line num, stop at end of file. (PhilRunninger) [#1015](https://github.com/scrooloose/nerdtree/pull/1015)
|
||||||
|
- **.3**: Fix `<CR>` key map on the bookmark (lkebin) [#1014](https://github.com/scrooloose/nerdtree/pull/1014)
|
||||||
|
- **.2**: Make Enter work on the `.. ( up a dir )` line (PhilRunninger) [#1013](https://github.com/scrooloose/nerdtree/pull/1013)
|
||||||
|
- **.1**: Fix nerdtree#version() on Windows. (PhilRunninger)
|
||||||
|
- **.0**: Expand functionality of `<CR>` mapping. (PhilRunninger) [#1011](https://github.com/scrooloose/nerdtree/pull/1011)
|
||||||
#### 5.1...
|
#### 5.1...
|
||||||
- **.3**: Remove @mentions from PR template and change log. They weren't working. (PhilRunninger) #1009
|
- **.3**: Remove @mentions from PR template and change log. They weren't working. (PhilRunninger) [#1009](https://github.com/scrooloose/nerdtree/pull/1009)
|
||||||
- **.2**: Fix NERDTree opening with the wrong size. (PhilRunninger) #1008
|
- **.2**: Fix NERDTree opening with the wrong size. (PhilRunninger) [#1008](https://github.com/scrooloose/nerdtree/pull/1008)
|
||||||
- **.1**: Update Changelog and create PR Template (PhilRunninger) #1007
|
- **.1**: Update Changelog and create PR Template (PhilRunninger) [#1007](https://github.com/scrooloose/nerdtree/pull/1007)
|
||||||
- **.0**: Too many changes for one patch...
|
- **.0**: Too many changes for one patch...
|
||||||
- Refresh a dir_node if the file wasn't found in it, and look once more. (PhilRunninger) #1005
|
- Refresh a dir_node if the file wasn't found in it, and look once more. (PhilRunninger) [#1005](https://github.com/scrooloose/nerdtree/pull/1005)
|
||||||
- Add a "copy path to clipboard" menu option (PhilRunninger) #1002
|
- Add a "copy path to clipboard" menu option (PhilRunninger) [#1002](https://github.com/scrooloose/nerdtree/pull/1002)
|
||||||
- Enable root refresh on "vim ." a different way than #999. (PhilRunninger) #1001
|
- Enable root refresh on "vim ." a different way than [#999](https://github.com/scrooloose/nerdtree/pull/999). (PhilRunninger) [#1001](https://github.com/scrooloose/nerdtree/pull/1001)
|
||||||
- Fix refreshroot (PhilRunninger) #999
|
- Fix refreshroot (PhilRunninger) [#999](https://github.com/scrooloose/nerdtree/pull/999)
|
||||||
- Change version check to look for 703 not 730 (vhalis) #994
|
- Change version check to look for 703 not 730 (vhalis) [#994](https://github.com/scrooloose/nerdtree/pull/994)
|
||||||
- Change minimum vim (PhilRunninger) #991
|
- Change minimum vim (PhilRunninger) [#991](https://github.com/scrooloose/nerdtree/pull/991)
|
||||||
- Allow multi-character DirArrows (PhilRunninger) #985
|
- Allow multi-character DirArrows (PhilRunninger) [#985](https://github.com/scrooloose/nerdtree/pull/985)
|
||||||
- Remove redraw! while still clearing last message empty string. (PhilRunninger) #979
|
- Remove redraw! while still clearing last message empty string. (PhilRunninger) [#979](https://github.com/scrooloose/nerdtree/pull/979)
|
||||||
- fix _initChildren function value set to numChildrenCached error (terryding77) #969
|
- fix `_initChildren` function value set to numChildrenCached error (terryding77) [#969](https://github.com/scrooloose/nerdtree/pull/969)
|
||||||
- On Windows, do a case-insensitive comparison of paths. (PhilRunninger) #967
|
- On Windows, do a case-insensitive comparison of paths. (PhilRunninger) [#967](https://github.com/scrooloose/nerdtree/pull/967)
|
||||||
- Remove the "Please wait... DONE" messages. (PhilRunninger) #966
|
- Remove the **Please wait... DONE** messages. (PhilRunninger) [#966](https://github.com/scrooloose/nerdtree/pull/966)
|
||||||
- Smarter delimiter default (PhilRunninger) #963
|
- Smarter delimiter default (PhilRunninger) [#963](https://github.com/scrooloose/nerdtree/pull/963)
|
||||||
- Update directory .vimdc readme example (spencerdcarlson) #961
|
- Update directory .vimdc readme example (spencerdcarlson) [#961](https://github.com/scrooloose/nerdtree/pull/961)
|
||||||
- Preview bookmarks (PhilRunninger) #956
|
- Preview bookmarks (PhilRunninger) [#956](https://github.com/scrooloose/nerdtree/pull/956)
|
||||||
- Add new value to NERDTreeQuitOnOpen to close bookmark table (PhilRunninger) #955
|
- Add new value to NERDTreeQuitOnOpen to close bookmark table (PhilRunninger) [#955](https://github.com/scrooloose/nerdtree/pull/955)
|
||||||
- Add an :EditBookmarks command to edit the bookmarks file (PhilRunninger) #954
|
- Add an :EditBookmarks command to edit the bookmarks file (PhilRunninger) [#954](https://github.com/scrooloose/nerdtree/pull/954)
|
||||||
- Before copying, turn off &shellslash. Restore after copy is finished. (PhilRunninger) #952
|
- Before copying, turn off &shellslash. Restore after copy is finished. (PhilRunninger) [#952](https://github.com/scrooloose/nerdtree/pull/952)
|
||||||
- Set a maximum window size when zooming. (PhilRunninger) #950
|
- Set a maximum window size when zooming. (PhilRunninger) [#950](https://github.com/scrooloose/nerdtree/pull/950)
|
||||||
- Confirm the wipeout of a unsaved buffer whose file has been renamed. (PhilRunninger) #949
|
- Confirm the wipeout of a unsaved buffer whose file has been renamed. (PhilRunninger) [#949](https://github.com/scrooloose/nerdtree/pull/949)
|
||||||
- Escape a backslash so it can be used in a key mapping. (PhilRunninger) #948
|
- Escape a backslash so it can be used in a key mapping. (PhilRunninger) [#948](https://github.com/scrooloose/nerdtree/pull/948)
|
||||||
- Add a NERDTreeMinimalMenu feature (tuzz) #938
|
- Add a NERDTreeMinimalMenu feature (tuzz) [#938](https://github.com/scrooloose/nerdtree/pull/938)
|
||||||
- fixed root path error for windows (zcodes) #935
|
- fixed root path error for windows (zcodes) [#935](https://github.com/scrooloose/nerdtree/pull/935)
|
||||||
- Restore getDirChildren for use in nerdtree-project-plugin. (PhilRunninger) #929
|
- Restore getDirChildren for use in nerdtree-project-plugin. (PhilRunninger) [#929](https://github.com/scrooloose/nerdtree/pull/929)
|
||||||
- Document NERDTreeNodeDelimiter #912 (PhilRunninger) #926
|
- Document NERDTreeNodeDelimiter [#912](https://github.com/scrooloose/nerdtree/pull/912) (PhilRunninger) [#926](https://github.com/scrooloose/nerdtree/pull/926)
|
||||||
- Allow modification of menu keybindings (Leandros) #923
|
- Allow modification of menu keybindings (Leandros) [#923](https://github.com/scrooloose/nerdtree/pull/923)
|
||||||
- Add two more disqualifications for isCascadable(). (PhilRunninger) #914
|
- Add two more disqualifications for isCascadable(). (PhilRunninger) [#914](https://github.com/scrooloose/nerdtree/pull/914)
|
||||||
- Allow highlighting more than one flag. (kristijanhusak) #908
|
- Allow highlighting more than one flag. (kristijanhusak) [#908](https://github.com/scrooloose/nerdtree/pull/908)
|
||||||
- Support sorting files and directories by modification time. (PhilRunninger) #901
|
- Support sorting files and directories by modification time. (PhilRunninger) [#901](https://github.com/scrooloose/nerdtree/pull/901)
|
||||||
- Parse . and .. from path string with trailing slash. (PhilRunninger) #899
|
- Parse . and .. from path string with trailing slash. (PhilRunninger) [#899](https://github.com/scrooloose/nerdtree/pull/899)
|
||||||
- Force sort to recalculate the cached sortKey. (PhilRunninger) #898
|
- Force sort to recalculate the cached sortKey. (PhilRunninger) [#898](https://github.com/scrooloose/nerdtree/pull/898)
|
||||||
- Add NERDTreeRefreshRoot command (wgfm) #897
|
- Add NERDTreeRefreshRoot command (wgfm) [#897](https://github.com/scrooloose/nerdtree/pull/897)
|
||||||
- Call Resolve on the file's path when calling :NERDTreeFind. (PhilRunninger) #896
|
- Call Resolve on the file's path when calling :NERDTreeFind. (PhilRunninger) [#896](https://github.com/scrooloose/nerdtree/pull/896)
|
||||||
- Catch all errors, not just NERDTree errors. (PhilRunninger) #894
|
- Catch all errors, not just NERDTree errors. (PhilRunninger) [#894](https://github.com/scrooloose/nerdtree/pull/894)
|
||||||
- Fix typo in help file (lvoisin) #892
|
- Fix typo in help file (lvoisin) [#892](https://github.com/scrooloose/nerdtree/pull/892)
|
||||||
- Make NERDTreeCreator set the `'nolist'` option (lifecrisis) #889
|
- Make NERDTreeCreator set the `'nolist'` option (lifecrisis) [#889](https://github.com/scrooloose/nerdtree/pull/889)
|
||||||
- Refresh buffers after `m`, `m` operation on a folder (PhilRunninger) #888
|
- Refresh buffers after `m`, `m` operation on a folder (PhilRunninger) [#888](https://github.com/scrooloose/nerdtree/pull/888)
|
||||||
- Use a better arg for FINDSTR when using the m,l command in Windows. (PhilRunninger) #887
|
- Use a better arg for FINDSTR when using the m,l command in Windows. (PhilRunninger) [#887](https://github.com/scrooloose/nerdtree/pull/887)
|
||||||
- Fix the <C-J>/<C-K> motions, which currently fail with cascades (lifecrisis) #886
|
- Fix the <C-J>/<C-K> motions, which currently fail with cascades (lifecrisis) [#886](https://github.com/scrooloose/nerdtree/pull/886)
|
||||||
- Function "s:UI.getLineNum()" doesn't always work on cascades. (lifecrisis) #882
|
- Function "s:UI.getLineNum()" doesn't always work on cascades. (lifecrisis) [#882](https://github.com/scrooloose/nerdtree/pull/882)
|
||||||
- NERDTreeCWD: reset CWD if changed by NERDTreeFocus (PhilRunninger) #878
|
- NERDTreeCWD: reset CWD if changed by NERDTreeFocus (PhilRunninger) [#878](https://github.com/scrooloose/nerdtree/pull/878)
|
||||||
- Use <count>tabnext instead of <count>gt to allow users to remap gt. (PhilRunninger) #877
|
- Use <count>tabnext instead of <count>gt to allow users to remap gt. (PhilRunninger) [#877](https://github.com/scrooloose/nerdtree/pull/877)
|
||||||
- Do a case sensitive comparison of new/existing buffers. (PhilRunninger) #875
|
- Do a case sensitive comparison of new/existing buffers. (PhilRunninger) [#875](https://github.com/scrooloose/nerdtree/pull/875)
|
||||||
- Fix opening sub-directories that have commas in their name. (PhilRunninger) #873
|
- Fix opening sub-directories that have commas in their name. (PhilRunninger) [#873](https://github.com/scrooloose/nerdtree/pull/873)
|
||||||
- Add new command to open NERDTree in the root of a VCS repository. (PhilRunninger) #872
|
- Add new command to open NERDTree in the root of a VCS repository. (PhilRunninger) [#872](https://github.com/scrooloose/nerdtree/pull/872)
|
||||||
- Make sure the path to the bookmarks file exists before writing it. (PhilRunninger) #871
|
- Make sure the path to the bookmarks file exists before writing it. (PhilRunninger) [#871](https://github.com/scrooloose/nerdtree/pull/871)
|
||||||
- Unzoom NERDTree when opening a file (PhilRunninger) #870
|
- Unzoom NERDTree when opening a file (PhilRunninger) [#870](https://github.com/scrooloose/nerdtree/pull/870)
|
||||||
- Support unusual characters in file and directory names (PhilRunninger) #868
|
- Support unusual characters in file and directory names (PhilRunninger) [#868](https://github.com/scrooloose/nerdtree/pull/868)
|
||||||
- Reword renamed-buffer prompt to be more clear (aflock) #867
|
- Reword renamed-buffer prompt to be more clear (aflock) [#867](https://github.com/scrooloose/nerdtree/pull/867)
|
||||||
- Default to placing cursor on root when closing bookmark table (lifecrisis) #866
|
- Default to placing cursor on root when closing bookmark table (lifecrisis) [#866](https://github.com/scrooloose/nerdtree/pull/866)
|
||||||
- Fix issues with sorting of nodes (PhilRunninger) #856
|
- Fix issues with sorting of nodes (PhilRunninger) [#856](https://github.com/scrooloose/nerdtree/pull/856)
|
||||||
- Better OSX detection (bubba-h57) #853
|
- Better OSX detection (bubba-h57) [#853](https://github.com/scrooloose/nerdtree/pull/853)
|
||||||
- Bugfix - ensure keymaps dictionary exists before using it (mnussbaum) #852
|
- Bugfix - ensure keymaps dictionary exists before using it (mnussbaum) [#852](https://github.com/scrooloose/nerdtree/pull/852)
|
||||||
- Decrease startup-time by avoiding linear-time iteration over key mappings (mnussbaum) #851
|
- Decrease startup-time by avoiding linear-time iteration over key mappings (mnussbaum) [#851](https://github.com/scrooloose/nerdtree/pull/851)
|
||||||
- Add code to sort mappings in quickhelp (lifecrisis) #849
|
- Add code to sort mappings in quickhelp (lifecrisis) [#849](https://github.com/scrooloose/nerdtree/pull/849)
|
||||||
- Use ":clearjumps" in new NERDTree windows (lifecrisis) #844
|
- Use ":clearjumps" in new NERDTree windows (lifecrisis) [#844](https://github.com/scrooloose/nerdtree/pull/844)
|
||||||
- Like m-c did before, create parent directories if needed on m-m. (PhilRunninger) #840
|
- Like m-c did before, create parent directories if needed on m-m. (PhilRunninger) [#840](https://github.com/scrooloose/nerdtree/pull/840)
|
||||||
- BUGFIX: Repair a problem with the `'u'` mapping. (lifecrisis) #838
|
- BUGFIX: Repair a problem with the `'u'` mapping. (lifecrisis) [#838](https://github.com/scrooloose/nerdtree/pull/838)
|
||||||
- Make the NERDTree buffer writable when rendering it. (PhilRunninger) #837
|
- Make the NERDTree buffer writable when rendering it. (PhilRunninger) [#837](https://github.com/scrooloose/nerdtree/pull/837)
|
||||||
- Code cleanup: Remove unsupported bookmark table mappings (lifecrisis) #835
|
- Code cleanup: Remove unsupported bookmark table mappings (lifecrisis) [#835](https://github.com/scrooloose/nerdtree/pull/835)
|
||||||
- Replace strcharpart() with substitute() for backward compatibility (bravestarr) #834
|
- Replace strcharpart() with substitute() for backward compatibility (bravestarr) [#834](https://github.com/scrooloose/nerdtree/pull/834)
|
||||||
- Fixed error `unknown function strcharpart` for older versions of Vim (hav4ik) #833
|
- Fixed error `unknown function strcharpart` for older versions of Vim (hav4ik) [#833](https://github.com/scrooloose/nerdtree/pull/833)
|
||||||
- Clear output when NERDTree menu is aborted (lifecrisis) #832
|
- Clear output when NERDTree menu is aborted (lifecrisis) [#832](https://github.com/scrooloose/nerdtree/pull/832)
|
||||||
- Display a path with multi-byte characters correctly when it is truncated (bravestarr) #830
|
- Display a path with multi-byte characters correctly when it is truncated (bravestarr) [#830](https://github.com/scrooloose/nerdtree/pull/830)
|
||||||
- Support revealing file and executing file with xdg-open for Linux (ngnmhieu) #824
|
- Support revealing file and executing file with xdg-open for Linux (ngnmhieu) [#824](https://github.com/scrooloose/nerdtree/pull/824)
|
||||||
- If node isn't open, count children on disk before deleting. (PhilRunninger) #822
|
- If node isn't open, count children on disk before deleting. (PhilRunninger) [#822](https://github.com/scrooloose/nerdtree/pull/822)
|
||||||
- Add new variable g:NERDTreeRemoveFileCmd (kutsan) #816
|
- Add new variable g:NERDTreeRemoveFileCmd (kutsan) [#816](https://github.com/scrooloose/nerdtree/pull/816)
|
||||||
- Use a better check for existence of the NERDTree buffer. (PhilRunninger) #814
|
- Use a better check for existence of the NERDTree buffer. (PhilRunninger) [#814](https://github.com/scrooloose/nerdtree/pull/814)
|
||||||
- Fix focussing previous buffer when closing NERDTree (mrubli) #801
|
- Fix focussing previous buffer when closing NERDTree (mrubli) [#801](https://github.com/scrooloose/nerdtree/pull/801)
|
||||||
- Update the docs for "NERDTreeStatusline" (lifecrisis) #796
|
- Update the docs for "NERDTreeStatusline" (lifecrisis) [#796](https://github.com/scrooloose/nerdtree/pull/796)
|
||||||
- BUGFIX: Unstable behavior in the "getPath()" method (lifecrisis) #795
|
- BUGFIX: Unstable behavior in the "getPath()" method (lifecrisis) [#795](https://github.com/scrooloose/nerdtree/pull/795)
|
||||||
- Revert the bugfix from pull request #785 (lifecrisis) #794
|
- Revert the bugfix from pull request [#785](https://github.com/scrooloose/nerdtree/pull/785) (lifecrisis) [#794](https://github.com/scrooloose/nerdtree/pull/794)
|
||||||
- BUGFIX: Allow ":NERDTreeFind" to discover hidden files (lifecrisis) #786
|
- BUGFIX: Allow ":NERDTreeFind" to discover hidden files (lifecrisis) [#786](https://github.com/scrooloose/nerdtree/pull/786)
|
||||||
- BUGFIX: Allow ":NERDTreeFind" to reveal new files (lifecrisis) #785
|
- BUGFIX: Allow ":NERDTreeFind" to reveal new files (lifecrisis) [#785](https://github.com/scrooloose/nerdtree/pull/785)
|
||||||
- Add modelines (lifecrisis) #782
|
- Add modelines (lifecrisis) [#782](https://github.com/scrooloose/nerdtree/pull/782)
|
||||||
- Change the type of completion used by NERDTreeFind (lifecrisis) #781
|
- Change the type of completion used by NERDTreeFind (lifecrisis) [#781](https://github.com/scrooloose/nerdtree/pull/781)
|
||||||
- change NERDTreeFind with args (zhenyangze) #778
|
- change NERDTreeFind with args (zhenyangze) [#778](https://github.com/scrooloose/nerdtree/pull/778)
|
||||||
- Style Choice: Using confirm() when deleting a bookmark (lifecrisis) #777
|
- Style Choice: Using confirm() when deleting a bookmark (lifecrisis) [#777](https://github.com/scrooloose/nerdtree/pull/777)
|
||||||
- remove useless substitute when `file =~# "/$"` (skyblueee) #773
|
- remove useless substitute when `file =~# "/$"` (skyblueee) [#773](https://github.com/scrooloose/nerdtree/pull/773)
|
||||||
- remove useless removeLeadingSpaces in _stripMarkup (skyblueee) #772
|
- remove useless removeLeadingSpaces in _stripMarkup (skyblueee) [#772](https://github.com/scrooloose/nerdtree/pull/772)
|
||||||
- Make the "o" mapping consistent with "x" (lifecrisis) #769
|
- Make the "o" mapping consistent with "x" (lifecrisis) [#769](https://github.com/scrooloose/nerdtree/pull/769)
|
||||||
- Fix a problem with the "x" handler (lifecrisis) #768
|
- Fix a problem with the "x" handler (lifecrisis) [#768](https://github.com/scrooloose/nerdtree/pull/768)
|
||||||
- Clean up the handler for the "x" mapping (lifecrisis) #767
|
- Clean up the handler for the "x" mapping (lifecrisis) [#767](https://github.com/scrooloose/nerdtree/pull/767)
|
||||||
- Revert change to tab opening method (lifecrisis) #766
|
- Revert change to tab opening method (lifecrisis) [#766](https://github.com/scrooloose/nerdtree/pull/766)
|
||||||
- BUGFIX: Add back support for "b:NERDTreeRoot" (lifecrisis) #765
|
- BUGFIX: Add back support for "b:NERDTreeRoot" (lifecrisis) [#765](https://github.com/scrooloose/nerdtree/pull/765)
|
||||||
- Fix broken "t" and "T" mappings, tabs now open at end (lifecrisis) #759
|
- Fix broken "t" and "T" mappings, tabs now open at end (lifecrisis) [#759](https://github.com/scrooloose/nerdtree/pull/759)
|
||||||
- Update doc with already existing mapping variables (asnr) #699
|
- Update doc with already existing mapping variables (asnr) [#699](https://github.com/scrooloose/nerdtree/pull/699)
|
||||||
- Fix the broken g:NERDTreeBookmarksSort setting (lifecrisis) #696
|
- Fix the broken g:NERDTreeBookmarksSort setting (lifecrisis) [#696](https://github.com/scrooloose/nerdtree/pull/696)
|
||||||
- Correct NERDTreeIgnore pattern in doc (cntoplolicon) #648
|
- Correct NERDTreeIgnore pattern in doc (cntoplolicon) [#648](https://github.com/scrooloose/nerdtree/pull/648)
|
||||||
- Remove empty segments when splitting path (sooth-sayer) #574
|
- Remove empty segments when splitting path (sooth-sayer) [#574](https://github.com/scrooloose/nerdtree/pull/574)
|
||||||
- Suppress autocmds less agressively (wincent) #578 #691
|
- Suppress autocmds less agressively (wincent) [#578](https://github.com/scrooloose/nerdtree/pull/578) [#691](https://github.com/scrooloose/nerdtree/pull/691)
|
||||||
- Add an Issues template to ask for more info initially.
|
- Add an Issues template to ask for more info initially.
|
||||||
- Fix markdown headers in readme (josephfrazier) #676
|
- Fix markdown headers in readme (josephfrazier) [#676](https://github.com/scrooloose/nerdtree/pull/676)
|
||||||
- Don't touch @o and @h registers when rendering
|
- Don't touch `@o` and `@h` registers when rendering
|
||||||
- Fix bug with files and directories with dollar signs (alegen) #649
|
- Fix bug with files and directories with dollar signs (alegen) [#649](https://github.com/scrooloose/nerdtree/pull/649)
|
||||||
- Reuse/reopen existing window trees where possible #244
|
- Reuse/reopen existing window trees where possible [#244](https://github.com/scrooloose/nerdtree/pull/244)
|
||||||
- Remove NERDTree.previousBuf()
|
- Remove NERDTree.previousBuf()
|
||||||
- Change color of arrow (Leeiio) #630
|
- Change color of arrow (Leeiio) [#630](https://github.com/scrooloose/nerdtree/pull/630)
|
||||||
- Improved a tip in README.markdown (ggicci) #628
|
- Improved a tip in README.markdown (ggicci) [#628](https://github.com/scrooloose/nerdtree/pull/628)
|
||||||
- Shorten delete confimration of empty directory to `y` (mikeperri) #530
|
- Shorten delete confimration of empty directory to `y` (mikeperri) [#530](https://github.com/scrooloose/nerdtree/pull/530)
|
||||||
- Fix API call to open directory tree in window (devm33) #533
|
- Fix API call to open directory tree in window (devm33) [#533](https://github.com/scrooloose/nerdtree/pull/533)
|
||||||
- Change default arrows on non-Windows platforms (gwilk) #546
|
- Change default arrows on non-Windows platforms (gwilk) [#546](https://github.com/scrooloose/nerdtree/pull/546)
|
||||||
- Update to README - combine cd and git clone (zwhitchcox) #584
|
- Update to README - combine cd and git clone (zwhitchcox) [#584](https://github.com/scrooloose/nerdtree/pull/584)
|
||||||
- Update to README - Tip: start NERDTree when vim starts (therealplato) #593
|
- Update to README - Tip: start NERDTree when vim starts (therealplato) [#593](https://github.com/scrooloose/nerdtree/pull/593)
|
||||||
- Escape filename when moving an open buffer (zacharyvoase) #595
|
- Escape filename when moving an open buffer (zacharyvoase) [#595](https://github.com/scrooloose/nerdtree/pull/595)
|
||||||
- Fixed incorrect :helptags command in README (curran) #619
|
- Fixed incorrect :helptags command in README (curran) [#619](https://github.com/scrooloose/nerdtree/pull/619)
|
||||||
- Fixed incomplete escaping of folder arrows (adityanatraj) #548
|
- Fixed incomplete escaping of folder arrows (adityanatraj) [#548](https://github.com/scrooloose/nerdtree/pull/548)
|
||||||
- Added NERDTreeCascadeSingleChildDir option (juanibiapina) #558
|
- Added NERDTreeCascadeSingleChildDir option (juanibiapina) [#558](https://github.com/scrooloose/nerdtree/pull/558)
|
||||||
- Replace strchars() with backward compatible workaround.
|
- Replace strchars() with backward compatible workaround.
|
||||||
- Add support for copy command in Windows (SkylerLipthay) #231
|
- Add support for copy command in Windows (SkylerLipthay) [#231](https://github.com/scrooloose/nerdtree/pull/231)
|
||||||
- Fixed typo in README.markdown - :Helptags -> :helptags
|
- Fixed typo in README.markdown - :Helptags -> :helptags
|
||||||
- Rename "primary" and "secondary" trees to "tab" and "window" trees.
|
- Rename "primary" and "secondary" trees to "tab" and "window" trees.
|
||||||
- Move a bunch of buffer level variables into the NERDTree and UI classes.
|
- Move a bunch of buffer level variables into the NERDTree and UI classes.
|
||||||
- Display cascading dirs on one line to save vertical/horizontal space (@matt-gardner: brainstorming/testing)
|
- Display cascading dirs on one line to save vertical/horizontal space (matt-gardner: brainstorming/testing)
|
||||||
- Remove the old style UI - Remove `NERDTreeDirArrows` option.
|
- Remove the old style UI - Remove `NERDTreeDirArrows` option.
|
||||||
- On windows default to + and ~ for expand/collapse directory symbols.
|
- On windows default to + and ~ for expand/collapse directory symbols.
|
||||||
- Lots more refactoring. Move a bunch of b: level vars into b:NERDTree and friends.
|
- Lots more refactoring. Move a bunch of b: level vars into b:NERDTree and friends.
|
||||||
@@ -132,7 +147,7 @@
|
|||||||
- Refactor the code significantly:
|
- Refactor the code significantly:
|
||||||
* Break the classes out into their own files.
|
* Break the classes out into their own files.
|
||||||
* Make the majority of the code OO - previously large parts were effectively a tangle of "global" methods.
|
* Make the majority of the code OO - previously large parts were effectively a tangle of "global" methods.
|
||||||
- Add an API to assign flags to nodes. This allows VCS plugins like https://github.com/Xuyuanp/nerdtree-git-plugin to exist. Thanks to @Xuyuanp for helping design/test/build said API.
|
- Add an API to assign flags to nodes. This allows VCS plugins like https://github.com/Xuyuanp/nerdtree-git-plugin to exist. Thanks to **Xuyuanp** for helping design/test/build said API.
|
||||||
- add `scope` argument to the key map API see :help NERDTreeAddKeyMap()
|
- add `scope` argument to the key map API see :help NERDTreeAddKeyMap()
|
||||||
- add magic [[dir]] and [[file]] flags to NERDTreeIgnore
|
- add magic [[dir]] and [[file]] flags to NERDTreeIgnore
|
||||||
- add support for custom path filters. See :help NERDTreeAddPathFilter()
|
- add support for custom path filters. See :help NERDTreeAddPathFilter()
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ endif
|
|||||||
let g:loaded_nerdtree_autoload = 1
|
let g:loaded_nerdtree_autoload = 1
|
||||||
|
|
||||||
let s:rootNERDTreePath = resolve(expand("<sfile>:p:h:h"))
|
let s:rootNERDTreePath = resolve(expand("<sfile>:p:h:h"))
|
||||||
|
|
||||||
|
"FUNCTION: nerdtree#version(...) {{{1
|
||||||
|
" If any value is given as an argument, the entire line of text from the
|
||||||
|
" change log is shown for the current version; otherwise, only the version
|
||||||
|
" number is shown.
|
||||||
function! nerdtree#version(...)
|
function! nerdtree#version(...)
|
||||||
let l:changelog = readfile(join([s:rootNERDTreePath, "CHANGELOG.md"], nerdtree#slash()))
|
let l:changelog = readfile(join([s:rootNERDTreePath, "CHANGELOG.md"], nerdtree#slash()))
|
||||||
let l:text = 'Unknown'
|
let l:text = 'Unknown'
|
||||||
@@ -22,6 +27,7 @@ endfunction
|
|||||||
" SECTION: General Functions {{{1
|
" SECTION: General Functions {{{1
|
||||||
"============================================================
|
"============================================================
|
||||||
|
|
||||||
|
"FUNCTION: nerdtree#slash() {{{2
|
||||||
function! nerdtree#slash()
|
function! nerdtree#slash()
|
||||||
|
|
||||||
if nerdtree#runningWindows()
|
if nerdtree#runningWindows()
|
||||||
@@ -49,7 +55,6 @@ function! nerdtree#and(x,y)
|
|||||||
if (l:x % 2) && (l:y % 2)
|
if (l:x % 2) && (l:y % 2)
|
||||||
let l:result += float2nr(pow(2, l:n))
|
let l:result += float2nr(pow(2, l:n))
|
||||||
endif
|
endif
|
||||||
echomsg l:x . ", " . l:y . " => " l:result
|
|
||||||
let l:x = float2nr(l:x / 2)
|
let l:x = float2nr(l:x / 2)
|
||||||
let l:y = float2nr(l:y / 2)
|
let l:y = float2nr(l:y / 2)
|
||||||
let l:n += 1
|
let l:n += 1
|
||||||
@@ -154,13 +159,13 @@ function! nerdtree#deprecated(func, ...)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: nerdtree#exec(cmd) {{{2
|
" FUNCTION: nerdtree#exec(cmd, ignoreAll) {{{2
|
||||||
" Same as :exec cmd but with eventignore set for the duration
|
" Same as :exec cmd but, if ignoreAll is TRUE, set eventignore=all for the duration
|
||||||
" to disable the autocommands used by NERDTree (BufEnter,
|
function! nerdtree#exec(cmd, ignoreAll)
|
||||||
" BufLeave and VimEnter)
|
|
||||||
function! nerdtree#exec(cmd)
|
|
||||||
let old_ei = &ei
|
let old_ei = &ei
|
||||||
set ei=BufEnter,BufLeave,VimEnter
|
if a:ignoreAll
|
||||||
|
set ei=all
|
||||||
|
endif
|
||||||
exec a:cmd
|
exec a:cmd
|
||||||
let &ei = old_ei
|
let &ei = old_ei
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ function! nerdtree#ui_glue#createDefaultBindings()
|
|||||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': 'Bookmark', 'callback': s . 'openInNewTabSilent' })
|
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': 'Bookmark', 'callback': s . 'openInNewTabSilent' })
|
||||||
|
|
||||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenExpl, 'scope': "DirNode", 'callback': s."openExplorer" })
|
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenExpl, 'scope': "DirNode", 'callback': s."openExplorer" })
|
||||||
|
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenExpl, 'scope': "FileNode", 'callback': s."openExplorer" })
|
||||||
|
|
||||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapDeleteBookmark, 'scope': "Bookmark", 'callback': s."deleteBookmark" })
|
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapDeleteBookmark, 'scope': "Bookmark", 'callback': s."deleteBookmark" })
|
||||||
endfunction
|
endfunction
|
||||||
@@ -283,6 +284,9 @@ endfunction
|
|||||||
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
||||||
function! s:findAndRevealPath(pathStr)
|
function! s:findAndRevealPath(pathStr)
|
||||||
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
|
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
|
||||||
|
if !filereadable(l:pathStr)
|
||||||
|
let l:pathStr = fnamemodify(l:pathStr, ':h')
|
||||||
|
endif
|
||||||
|
|
||||||
if empty(l:pathStr)
|
if empty(l:pathStr)
|
||||||
call nerdtree#echoWarning('no file for the current buffer')
|
call nerdtree#echoWarning('no file for the current buffer')
|
||||||
@@ -574,11 +578,11 @@ function! s:refreshRoot()
|
|||||||
call nerdtree#echo("Refreshing the root node. This could take a while...")
|
call nerdtree#echo("Refreshing the root node. This could take a while...")
|
||||||
|
|
||||||
let l:curWin = winnr()
|
let l:curWin = winnr()
|
||||||
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w")
|
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w", 1)
|
||||||
call b:NERDTree.root.refresh()
|
call b:NERDTree.root.refresh()
|
||||||
call b:NERDTree.render()
|
call b:NERDTree.render()
|
||||||
redraw
|
redraw
|
||||||
call nerdtree#exec(l:curWin . "wincmd w")
|
call nerdtree#exec(l:curWin . "wincmd w", 1)
|
||||||
call nerdtree#echo("")
|
call nerdtree#echo("")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -1043,28 +1043,31 @@ window. Use one of the follow lines for this setting: >
|
|||||||
Values: a list of regular expressions.
|
Values: a list of regular expressions.
|
||||||
Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$']
|
Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$']
|
||||||
|
|
||||||
This setting is a list of regular expressions which are used to specify the
|
This setting is a list of regular expressions which are used to group or sort
|
||||||
order of nodes under their parent.
|
the nodes under their parent.
|
||||||
|
|
||||||
For example, if the setting is: >
|
For example, if the setting is: >
|
||||||
['\.vim$', '\.c$', '\.h$', '*', 'foobar']
|
['\.vim$', '\.c$', '\.h$', '*', 'foobar']
|
||||||
<
|
<
|
||||||
then all .vim files will be placed at the top, followed by all .c files then
|
then all .vim files will be grouped at the top, followed by all .c files then
|
||||||
all .h files. All files containing the string 'foobar' will be placed at the
|
all .h files. All files containing the string 'foobar' will be placed at the
|
||||||
end. The star is a special flag: it tells the script that every node that
|
end. The star is a special flag: it tells the script that every node that
|
||||||
doesn't match any of the other regexps should be placed here.
|
doesn't match any of the other regexps should be placed here.
|
||||||
|
|
||||||
If no star is present in NERDTreeSortOrder then one is automatically
|
If no star is present in NERDTreeSortOrder, then one is automatically
|
||||||
appended to the array.
|
appended to the end of the list.
|
||||||
|
|
||||||
The regex '\/$' should be used to match directory nodes.
|
The regex '\/$' should be used to match directory nodes.
|
||||||
|
|
||||||
A special flag can be used to sort by the modification timestamps of files and
|
Files can also be sorted by 1) the modification timestamp, 2) the size, or 3)
|
||||||
directories. It is either '[[timestamp]]' for ascending, or '[[-timestamp]]'
|
the extension. Directories are always sorted by name. To accomplish this, the
|
||||||
for descending. If placed at the beginning of the list, files and directories
|
following special flags are used:
|
||||||
are sorted by timestamp, and then by the remaining items in the sort order
|
[[timestamp]] [[-timestamp]] [[size]] [[-size]] [[extension]]
|
||||||
list. If this flag is in any other position of the list, timestamp sorting is
|
The hyphen specifies a descending sort; extensions are sorted in ascending
|
||||||
done secondarily. See examples 4, 5, and 6 below.
|
order only. If placed at the beginning of the list, files are sorted according
|
||||||
|
to these flags first, and then grouped by the remaining items in the list. If
|
||||||
|
the flags are in any other position of the list, this special sorting is done
|
||||||
|
secondarily. See examples 4, 5, and 6 below.
|
||||||
|
|
||||||
After this sorting is done, the files in each group are sorted alphabetically.
|
After this sorting is done, the files in each group are sorted alphabetically.
|
||||||
|
|
||||||
@@ -1072,20 +1075,20 @@ Examples: >
|
|||||||
(1) ['*', '\/$']
|
(1) ['*', '\/$']
|
||||||
(2) []
|
(2) []
|
||||||
(3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$']
|
(3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$']
|
||||||
(4) ['[[timestamp]]']
|
(4) ['[[-size]]']
|
||||||
(5) ['\/$', '*', '[[-timestamp]]']
|
(5) ['\/$', '*', '[[timestamp]]']
|
||||||
(6) ['\.md$', '\.c$', '[[-timestamp]]', '*']
|
(6) ['foo','\/$','[[extension]]']
|
||||||
<
|
<
|
||||||
1. Directories will appear last, everything else will appear above.
|
1. Directories will appear last, everything else will appear above.
|
||||||
2. Everything will simply appear in alphabetical order.
|
2. Everything will simply appear in alphabetical order.
|
||||||
3. Dirs will appear first, then ruby and php. Swap files, bak files and vim
|
3. Dirs will appear first, then ruby and php. Swap files, bak files and vim
|
||||||
backup files will appear last with everything else preceding them.
|
backup files will appear last with everything else preceding them.
|
||||||
4. All files and directories are sorted by timestamp, oldest first. If any
|
4. Everything is sorted by size, largest to smallest, with directories
|
||||||
files have identical timestamps, they are sorted alphabetically.
|
considered to have size 0 bytes.
|
||||||
5. Directories are first, newest to oldest, then everything else, newest to
|
5. Directories will appear first alphabetically, followed by files, sorted by
|
||||||
oldest.
|
timestamp, oldest first.
|
||||||
6. Markdown files first, followed by C source files, then everything else.
|
6. Files and directories matching 'foo' first, followed by other directories,
|
||||||
Each group is shown newest to oldest.
|
then all other files. Each section of files is sorted by file extension.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDTreeStatusline*
|
*NERDTreeStatusline*
|
||||||
|
|||||||
@@ -159,8 +159,8 @@ endfunction
|
|||||||
" FUNCTION: s:Edit() {{{1
|
" FUNCTION: s:Edit() {{{1
|
||||||
" opens the NERDTreeBookmarks file for manual editing
|
" opens the NERDTreeBookmarks file for manual editing
|
||||||
function! s:Bookmark.Edit()
|
function! s:Bookmark.Edit()
|
||||||
execute "wincmd w"
|
call nerdtree#exec("wincmd w", 1)
|
||||||
execute "edit ".g:NERDTreeBookmarksFile
|
call nerdtree#exec("edit ".g:NERDTreeBookmarksFile, 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Bookmark.getNode(nerdtree, searchFromAbsoluteRoot) {{{1
|
" FUNCTION: Bookmark.getNode(nerdtree, searchFromAbsoluteRoot) {{{1
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ function! s:MenuController.showMenu()
|
|||||||
let l:done = 0
|
let l:done = 0
|
||||||
|
|
||||||
while !l:done
|
while !l:done
|
||||||
redraw!
|
if has('nvim')
|
||||||
|
mode
|
||||||
|
else
|
||||||
|
redraw!
|
||||||
|
endif
|
||||||
call self._echoPrompt()
|
call self._echoPrompt()
|
||||||
|
|
||||||
let l:key = nr2char(getchar())
|
let l:key = nr2char(getchar())
|
||||||
@@ -58,13 +62,14 @@ function! s:MenuController._echoPrompt()
|
|||||||
|
|
||||||
if self.isMinimal()
|
if self.isMinimal()
|
||||||
let selection = self.menuItems[self.selection].text
|
let selection = self.menuItems[self.selection].text
|
||||||
|
let keyword = matchstr(selection, "\([^ ]*")
|
||||||
|
|
||||||
let shortcuts = map(copy(self.menuItems), "v:val['shortcut']")
|
let shortcuts = map(copy(self.menuItems), "v:val['shortcut']")
|
||||||
let shortcuts[self.selection] = " " . split(selection)[0] . " "
|
let shortcuts[self.selection] = " " . keyword . " "
|
||||||
|
|
||||||
echo "Menu: [" . join(shortcuts, ",") . "] (" . navHelp . " or shortcut): "
|
echo "Menu: [" . join(shortcuts, ",") . "] (" . navHelp . " or shortcut): "
|
||||||
else
|
else
|
||||||
echo "NERDTree Menu. " . navHelp . " . or the shortcuts indicated"
|
echo "NERDTree Menu. " . navHelp . ", or the shortcuts indicated"
|
||||||
echo "========================================================="
|
echo "========================================================="
|
||||||
|
|
||||||
for i in range(0, len(self.menuItems)-1)
|
for i in range(0, len(self.menuItems)-1)
|
||||||
|
|||||||
@@ -44,19 +44,19 @@ function! s:NERDTree.Close()
|
|||||||
let l:useWinId = exists('*win_getid') && exists('*win_gotoid')
|
let l:useWinId = exists('*win_getid') && exists('*win_gotoid')
|
||||||
|
|
||||||
if winnr() == s:NERDTree.GetWinNum()
|
if winnr() == s:NERDTree.GetWinNum()
|
||||||
call nerdtree#exec("wincmd p")
|
call nerdtree#exec("wincmd p", 1)
|
||||||
let l:activeBufOrWin = l:useWinId ? win_getid() : bufnr("")
|
let l:activeBufOrWin = l:useWinId ? win_getid() : bufnr("")
|
||||||
call nerdtree#exec("wincmd p")
|
call nerdtree#exec("wincmd p", 1)
|
||||||
else
|
else
|
||||||
let l:activeBufOrWin = l:useWinId ? win_getid() : bufnr("")
|
let l:activeBufOrWin = l:useWinId ? win_getid() : bufnr("")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call nerdtree#exec(s:NERDTree.GetWinNum() . " wincmd w")
|
call nerdtree#exec(s:NERDTree.GetWinNum() . " wincmd w", 1)
|
||||||
close
|
call nerdtree#exec("close", 0)
|
||||||
if l:useWinId
|
if l:useWinId
|
||||||
call nerdtree#exec("call win_gotoid(" . l:activeBufOrWin . ")")
|
call nerdtree#exec("call win_gotoid(" . l:activeBufOrWin . ")", 0)
|
||||||
else
|
else
|
||||||
call nerdtree#exec(bufwinnr(l:activeBufOrWin) . " wincmd w")
|
call nerdtree#exec(bufwinnr(l:activeBufOrWin) . " wincmd w", 0)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
close
|
close
|
||||||
@@ -98,7 +98,7 @@ endfunction
|
|||||||
"Places the cursor in the nerd tree window
|
"Places the cursor in the nerd tree window
|
||||||
function! s:NERDTree.CursorToTreeWin()
|
function! s:NERDTree.CursorToTreeWin()
|
||||||
call g:NERDTree.MustBeOpen()
|
call g:NERDTree.MustBeOpen()
|
||||||
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w")
|
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w", 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: s:NERDTree.ExistsForBuffer() {{{1
|
" Function: s:NERDTree.ExistsForBuffer() {{{1
|
||||||
@@ -148,12 +148,19 @@ function! s:NERDTree.GetWinNum()
|
|||||||
return bufwinnr(t:NERDTreeBufName)
|
return bufwinnr(t:NERDTreeBufName)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" If WindowTree, there is no t:NERDTreeBufName variable. Search all windows.
|
||||||
|
for w in range(1,winnr('$'))
|
||||||
|
if bufname(winbufnr(w)) =~# '^' . g:NERDTreeCreator.BufNamePrefix() . '\d\+$'
|
||||||
|
return w
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
return -1
|
return -1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: s:NERDTree.IsOpen() {{{1
|
"FUNCTION: s:NERDTree.IsOpen() {{{1
|
||||||
function! s:NERDTree.IsOpen()
|
function! s:NERDTree.IsOpen()
|
||||||
return s:NERDTree.GetWinNum() != -1 || bufname('%') =~# '^' . g:NERDTreeCreator.BufNamePrefix() . '\d\+$'
|
return s:NERDTree.GetWinNum() != -1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: s:NERDTree.isTabTree() {{{1
|
"FUNCTION: s:NERDTree.isTabTree() {{{1
|
||||||
|
|||||||
@@ -71,9 +71,9 @@ endfunction
|
|||||||
function! s:Opener._gotoTargetWin()
|
function! s:Opener._gotoTargetWin()
|
||||||
if b:NERDTree.isWinTree()
|
if b:NERDTree.isWinTree()
|
||||||
if self._where == 'v'
|
if self._where == 'v'
|
||||||
vsplit
|
call self._newVSplit()
|
||||||
elseif self._where == 'h'
|
elseif self._where == 'h'
|
||||||
split
|
call self._newSplit()
|
||||||
elseif self._where == 't'
|
elseif self._where == 't'
|
||||||
tabnew
|
tabnew
|
||||||
endif
|
endif
|
||||||
@@ -107,10 +107,10 @@ function! s:Opener._isWindowUsable(winnumber)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let oldwinnr = winnr()
|
let oldwinnr = winnr()
|
||||||
call nerdtree#exec(a:winnumber . "wincmd p")
|
call nerdtree#exec(a:winnumber . "wincmd p", 1)
|
||||||
let specialWindow = getbufvar("%", '&buftype') != '' || getwinvar('%', '&previewwindow')
|
let specialWindow = getbufvar("%", '&buftype') != '' || getwinvar('%', '&previewwindow')
|
||||||
let modified = &modified
|
let modified = &modified
|
||||||
call nerdtree#exec(oldwinnr . "wincmd p")
|
call nerdtree#exec(oldwinnr . "wincmd p", 1)
|
||||||
|
|
||||||
"if its a special window e.g. quickfix or another explorer plugin then we
|
"if its a special window e.g. quickfix or another explorer plugin then we
|
||||||
"have to split
|
"have to split
|
||||||
@@ -153,44 +153,18 @@ endfunction
|
|||||||
|
|
||||||
" FUNCTION: Opener._newSplit() {{{1
|
" FUNCTION: Opener._newSplit() {{{1
|
||||||
function! s:Opener._newSplit()
|
function! s:Opener._newSplit()
|
||||||
" Save the user's settings for splitbelow and splitright
|
|
||||||
let savesplitbelow=&splitbelow
|
|
||||||
let savesplitright=&splitright
|
|
||||||
|
|
||||||
" 'there' will be set to a command to move from the split window
|
|
||||||
" back to the explorer window
|
|
||||||
"
|
|
||||||
" 'back' will be set to a command to move from the explorer window
|
|
||||||
" back to the newly split window
|
|
||||||
"
|
|
||||||
" 'right' and 'below' will be set to the settings needed for
|
|
||||||
" splitbelow and splitright IF the explorer is the only window.
|
|
||||||
"
|
|
||||||
let there= g:NERDTreeWinPos ==# "left" ? "wincmd h" : "wincmd l"
|
|
||||||
let back = g:NERDTreeWinPos ==# "left" ? "wincmd l" : "wincmd h"
|
|
||||||
let right= g:NERDTreeWinPos ==# "left"
|
|
||||||
let below=0
|
|
||||||
|
|
||||||
" Attempt to go to adjacent window
|
|
||||||
call nerdtree#exec(back)
|
|
||||||
|
|
||||||
let onlyOneWin = (winnr("$") ==# 1)
|
let onlyOneWin = (winnr("$") ==# 1)
|
||||||
|
let savesplitright = &splitright
|
||||||
" If no adjacent window, set splitright and splitbelow appropriately
|
|
||||||
if onlyOneWin
|
if onlyOneWin
|
||||||
let &splitright=right
|
let &splitright = (g:NERDTreeWinPos ==# "left")
|
||||||
let &splitbelow=below
|
|
||||||
else
|
|
||||||
" found adjacent window - invert split direction
|
|
||||||
let &splitright=!right
|
|
||||||
let &splitbelow=!below
|
|
||||||
endif
|
endif
|
||||||
|
" If only one window (ie. NERDTree), split vertically instead.
|
||||||
let splitMode = onlyOneWin ? "vertical" : ""
|
let splitMode = onlyOneWin ? "vertical" : ""
|
||||||
|
|
||||||
" Open the new window
|
" Open the new window
|
||||||
try
|
try
|
||||||
exec(splitMode." sp ")
|
call nerdtree#exec('wincmd p', 1)
|
||||||
|
call nerdtree#exec(splitMode . " split",1)
|
||||||
catch /^Vim\%((\a\+)\)\=:E37/
|
catch /^Vim\%((\a\+)\)\=:E37/
|
||||||
call g:NERDTree.CursorToTreeWin()
|
call g:NERDTree.CursorToTreeWin()
|
||||||
throw "NERDTree.FileAlreadyOpenAndModifiedError: ". self._path.str() ." is already open and modified."
|
throw "NERDTree.FileAlreadyOpenAndModifiedError: ". self._path.str() ." is already open and modified."
|
||||||
@@ -200,14 +174,12 @@ function! s:Opener._newSplit()
|
|||||||
|
|
||||||
"resize the tree window if no other window was open before
|
"resize the tree window if no other window was open before
|
||||||
if onlyOneWin
|
if onlyOneWin
|
||||||
let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
|
let size = exists('b:NERDTreeOldWindowSize') ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
|
||||||
call nerdtree#exec(there)
|
call nerdtree#exec('wincmd p', 1)
|
||||||
exec("silent ". splitMode ." resize ". size)
|
call nerdtree#exec('silent '. splitMode .' resize '. size, 1)
|
||||||
call nerdtree#exec('wincmd p')
|
call nerdtree#exec('wincmd p', 0)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Restore splitmode settings
|
|
||||||
let &splitbelow=savesplitbelow
|
|
||||||
let &splitright=savesplitright
|
let &splitright=savesplitright
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -215,12 +187,15 @@ endfunction
|
|||||||
function! s:Opener._newVSplit()
|
function! s:Opener._newVSplit()
|
||||||
let l:winwidth = winwidth('.')
|
let l:winwidth = winwidth('.')
|
||||||
|
|
||||||
if winnr('$') == 1
|
let onlyOneWin = (winnr("$") ==# 1)
|
||||||
|
let savesplitright = &splitright
|
||||||
|
if onlyOneWin
|
||||||
|
let &splitright = (g:NERDTreeWinPos ==# "left")
|
||||||
let l:winwidth = g:NERDTreeWinSize
|
let l:winwidth = g:NERDTreeWinSize
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call nerdtree#exec('wincmd p')
|
call nerdtree#exec('wincmd p', 1)
|
||||||
vnew
|
call nerdtree#exec('vnew', 1)
|
||||||
|
|
||||||
let l:currentWindowNumber = winnr()
|
let l:currentWindowNumber = winnr()
|
||||||
|
|
||||||
@@ -228,7 +203,8 @@ function! s:Opener._newVSplit()
|
|||||||
call g:NERDTree.CursorToTreeWin()
|
call g:NERDTree.CursorToTreeWin()
|
||||||
execute 'silent vertical resize ' . l:winwidth
|
execute 'silent vertical resize ' . l:winwidth
|
||||||
|
|
||||||
call nerdtree#exec(l:currentWindowNumber . 'wincmd w')
|
call nerdtree#exec(l:currentWindowNumber . 'wincmd w', 0)
|
||||||
|
let &splitright=savesplitright
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Opener.open(target) {{{1
|
" FUNCTION: Opener.open(target) {{{1
|
||||||
@@ -290,9 +266,9 @@ function! s:Opener._previousWindow()
|
|||||||
else
|
else
|
||||||
try
|
try
|
||||||
if !self._isWindowUsable(winnr("#"))
|
if !self._isWindowUsable(winnr("#"))
|
||||||
call nerdtree#exec(self._firstUsableWindow() . "wincmd w")
|
call nerdtree#exec(self._firstUsableWindow() . "wincmd w", 1)
|
||||||
else
|
else
|
||||||
call nerdtree#exec('wincmd p')
|
call nerdtree#exec('wincmd p', 1)
|
||||||
endif
|
endif
|
||||||
catch /^Vim\%((\a\+)\)\=:E37/
|
catch /^Vim\%((\a\+)\)\=:E37/
|
||||||
call g:NERDTree.CursorToTreeWin()
|
call g:NERDTree.CursorToTreeWin()
|
||||||
@@ -305,8 +281,8 @@ endfunction
|
|||||||
|
|
||||||
" FUNCTION: Opener._restoreCursorPos() {{{1
|
" FUNCTION: Opener._restoreCursorPos() {{{1
|
||||||
function! s:Opener._restoreCursorPos()
|
function! s:Opener._restoreCursorPos()
|
||||||
call nerdtree#exec(self._tabnr . 'tabnext')
|
call nerdtree#exec(self._tabnr . 'tabnext', 1)
|
||||||
call nerdtree#exec(bufwinnr(self._bufnr) . 'wincmd w')
|
call nerdtree#exec(bufwinnr(self._bufnr) . 'wincmd w', 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: Opener._reuseWindow() {{{1
|
" FUNCTION: Opener._reuseWindow() {{{1
|
||||||
@@ -321,7 +297,7 @@ function! s:Opener._reuseWindow()
|
|||||||
"check the current tab for the window
|
"check the current tab for the window
|
||||||
let winnr = bufwinnr('^' . self._path.str() . '$')
|
let winnr = bufwinnr('^' . self._path.str() . '$')
|
||||||
if winnr != -1
|
if winnr != -1
|
||||||
call nerdtree#exec(winnr . "wincmd w")
|
call nerdtree#exec(winnr . "wincmd w", 0)
|
||||||
call self._checkToCloseTree(0)
|
call self._checkToCloseTree(0)
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
@@ -334,9 +310,9 @@ function! s:Opener._reuseWindow()
|
|||||||
let tabnr = self._path.tabnr()
|
let tabnr = self._path.tabnr()
|
||||||
if tabnr
|
if tabnr
|
||||||
call self._checkToCloseTree(1)
|
call self._checkToCloseTree(1)
|
||||||
call nerdtree#exec(tabnr . 'tabnext')
|
call nerdtree#exec(tabnr . 'tabnext', 1)
|
||||||
let winnr = bufwinnr('^' . self._path.str() . '$')
|
let winnr = bufwinnr('^' . self._path.str() . '$')
|
||||||
call nerdtree#exec(winnr . "wincmd w")
|
call nerdtree#exec(winnr . "wincmd w", 0)
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -380,7 +380,8 @@ endfunction
|
|||||||
function! s:Path.getSortOrderIndex()
|
function! s:Path.getSortOrderIndex()
|
||||||
let i = 0
|
let i = 0
|
||||||
while i < len(g:NERDTreeSortOrder)
|
while i < len(g:NERDTreeSortOrder)
|
||||||
if self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i]
|
if g:NERDTreeSortOrder[i] !~? '\[\[-\?\(timestamp\|size\|extension\)\]\]' &&
|
||||||
|
\ self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i]
|
||||||
return i
|
return i
|
||||||
endif
|
endif
|
||||||
let i = i + 1
|
let i = i + 1
|
||||||
@@ -407,15 +408,26 @@ endfunction
|
|||||||
" FUNCTION: Path.getSortKey() {{{1
|
" FUNCTION: Path.getSortKey() {{{1
|
||||||
" returns a key used in compare function for sorting
|
" returns a key used in compare function for sorting
|
||||||
function! s:Path.getSortKey()
|
function! s:Path.getSortKey()
|
||||||
let l:ascending = index(g:NERDTreeSortOrder,'[[timestamp]]')
|
if !exists("self._sortKey") || g:NERDTreeSortOrder !=# g:NERDTreeOldSortOrder
|
||||||
let l:descending = index(g:NERDTreeSortOrder,'[[-timestamp]]')
|
" Look for file metadata tags: [[timestamp]], [[extension]], [[size]]
|
||||||
if !exists("self._sortKey") || g:NERDTreeSortOrder !=# g:NERDTreeOldSortOrder || l:ascending >= 0 || l:descending >= 0
|
let metadata = []
|
||||||
let self._sortKey = [self.getSortOrderIndex()]
|
for tag in g:NERDTreeSortOrder
|
||||||
|
if tag =~? '\[\[-\?timestamp\]\]'
|
||||||
|
let metadata += [self.isDirectory ? 0 : getftime(self.str()) * (tag =~ '-' ? -1 : 1)]
|
||||||
|
elseif tag =~? '\[\[-\?size\]\]'
|
||||||
|
let metadata += [self.isDirectory ? 0 : getfsize(self.str()) * (tag =~ '-' ? -1 : 1)]
|
||||||
|
elseif tag =~? '\[\[extension\]\]'
|
||||||
|
let extension = matchstr(self.getLastPathComponent(0), '[^.]\+\.\zs[^.]\+$')
|
||||||
|
let metadata += [self.isDirectory ? '' : (extension == '' ? nr2char(str2nr('0x10ffff',16)) : extension)]
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
if l:descending >= 0
|
if g:NERDTreeSortOrder[0] =~ '\[\[.*\]\]'
|
||||||
call insert(self._sortKey, -getftime(self.str()), l:descending == 0 ? 0 : len(self._sortKey))
|
" Apply tags' sorting first if specified first.
|
||||||
elseif l:ascending >= 0
|
let self._sortKey = metadata + [self.getSortOrderIndex()]
|
||||||
call insert(self._sortKey, getftime(self.str()), l:ascending == 0 ? 0 : len(self._sortKey))
|
else
|
||||||
|
" Otherwise, do regex grouping first.
|
||||||
|
let self._sortKey = [self.getSortOrderIndex()] + metadata
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let path = self.getLastPathComponent(1)
|
let path = self.getLastPathComponent(1)
|
||||||
|
|||||||
@@ -523,7 +523,8 @@ endfunction
|
|||||||
" Open an explorer window for this node in the previous window. The explorer
|
" Open an explorer window for this node in the previous window. The explorer
|
||||||
" can be a NERDTree window or a netrw window.
|
" can be a NERDTree window or a netrw window.
|
||||||
function! s:TreeDirNode.openExplorer()
|
function! s:TreeDirNode.openExplorer()
|
||||||
call self.open({'where': 'p'})
|
execute "wincmd p"
|
||||||
|
execute "edit ".self.path.str({'format':'Edit'})
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: TreeDirNode.openInNewTab(options) {{{1
|
" FUNCTION: TreeDirNode.openInNewTab(options) {{{1
|
||||||
|
|||||||
@@ -246,6 +246,12 @@ function! s:TreeFileNode.openInNewTab(options)
|
|||||||
call self.open(extend({'where': 't'}, a:options))
|
call self.open(extend({'where': 't'}, a:options))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" FUNCTION: TreeFileNode.openExplorer()
|
||||||
|
function! s:TreeFileNode.openExplorer()
|
||||||
|
execute "wincmd p"
|
||||||
|
execute "edit ".self.path.getParent().str({'format':'Edit'})
|
||||||
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: TreeFileNode.putCursorHere(isJump, recurseUpward){{{1
|
" FUNCTION: TreeFileNode.putCursorHere(isJump, recurseUpward){{{1
|
||||||
" Places the cursor on the line number this node is rendered on
|
" Places the cursor on the line number this node is rendered on
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ function! s:UI.restoreScreenState()
|
|||||||
if !has_key(self, '_screenState')
|
if !has_key(self, '_screenState')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
exec("silent vertical resize " . self._screenState['oldWindowSize'])
|
call nerdtree#exec("silent vertical resize " . self._screenState['oldWindowSize'], 1)
|
||||||
|
|
||||||
let old_scrolloff=&scrolloff
|
let old_scrolloff=&scrolloff
|
||||||
let &scrolloff=0
|
let &scrolloff=0
|
||||||
@@ -360,7 +360,7 @@ function! s:UI.saveScreenState()
|
|||||||
let self._screenState['oldPos'] = getpos(".")
|
let self._screenState['oldPos'] = getpos(".")
|
||||||
let self._screenState['oldTopLine'] = line("w0")
|
let self._screenState['oldTopLine'] = line("w0")
|
||||||
let self._screenState['oldWindowSize']= winwidth("")
|
let self._screenState['oldWindowSize']= winwidth("")
|
||||||
call nerdtree#exec(win . "wincmd w")
|
call nerdtree#exec(win . "wincmd w", 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: s:UI.setShowHidden(val) {{{1
|
" FUNCTION: s:UI.setShowHidden(val) {{{1
|
||||||
@@ -506,10 +506,10 @@ endfunction
|
|||||||
function! s:UI.toggleZoom()
|
function! s:UI.toggleZoom()
|
||||||
if exists("b:NERDTreeZoomed") && b:NERDTreeZoomed
|
if exists("b:NERDTreeZoomed") && b:NERDTreeZoomed
|
||||||
let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
|
let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
|
||||||
exec "silent vertical resize ". size
|
call nerdtree#exec("silent vertical resize ". size, 1)
|
||||||
let b:NERDTreeZoomed = 0
|
let b:NERDTreeZoomed = 0
|
||||||
else
|
else
|
||||||
exec "vertical resize ". get(g:, 'NERDTreeWinSizeMax', '')
|
call nerdtree#exec("vertical resize ". get(g:, 'NERDTreeWinSizeMax', ''), 1)
|
||||||
let b:NERDTreeZoomed = 1
|
let b:NERDTreeZoomed = 1
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -114,14 +114,14 @@ function! s:promptToDelBuffer(bufnum, msg)
|
|||||||
let l:listedBufferCount = 0
|
let l:listedBufferCount = 0
|
||||||
endif
|
endif
|
||||||
if l:listedBufferCount > 1
|
if l:listedBufferCount > 1
|
||||||
exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':bnext! ' | endif"
|
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':bnext! ' | endif", 1)
|
||||||
else
|
else
|
||||||
exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':enew! ' | endif"
|
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':enew! ' | endif", 1)
|
||||||
endif
|
endif
|
||||||
exec "tabnext " . s:originalTabNumber
|
call nerdtree#exec("tabnext " . s:originalTabNumber, 1)
|
||||||
exec s:originalWindowNumber . "wincmd w"
|
call nerdtree#exec(s:originalWindowNumber . "wincmd w", 1)
|
||||||
" 3. We don't need a previous buffer anymore
|
" 3. We don't need a previous buffer anymore
|
||||||
exec "bwipeout! " . a:bufnum
|
call nerdtree#exec("bwipeout! " . a:bufnum, 0)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -141,17 +141,17 @@ function! s:renameBuffer(bufNum, newNodeName, isDirectory)
|
|||||||
let editStr = g:NERDTreePath.New(a:newNodeName).str({'format': 'Edit'})
|
let editStr = g:NERDTreePath.New(a:newNodeName).str({'format': 'Edit'})
|
||||||
endif
|
endif
|
||||||
" 1. ensure that a new buffer is loaded
|
" 1. ensure that a new buffer is loaded
|
||||||
exec "badd " . quotedFileName
|
call nerdtree#exec("badd " . quotedFileName, 1)
|
||||||
" 2. ensure that all windows which display the just deleted filename
|
" 2. ensure that all windows which display the just deleted filename
|
||||||
" display a buffer for a new filename.
|
" display a buffer for a new filename.
|
||||||
let s:originalTabNumber = tabpagenr()
|
let s:originalTabNumber = tabpagenr()
|
||||||
let s:originalWindowNumber = winnr()
|
let s:originalWindowNumber = winnr()
|
||||||
exec "tabdo windo if winbufnr(0) == " . a:bufNum . " | exec ':e! " . editStr . "' | endif"
|
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufNum . " | exec ':e! " . editStr . "' | endif", 1)
|
||||||
exec "tabnext " . s:originalTabNumber
|
call nerdtree#exec("tabnext " . s:originalTabNumber, 1)
|
||||||
exec s:originalWindowNumber . "wincmd w"
|
call nerdtree#exec(s:originalWindowNumber . "wincmd w", 1)
|
||||||
" 3. We don't need a previous buffer anymore
|
" 3. We don't need a previous buffer anymore
|
||||||
try
|
try
|
||||||
exec "confirm bwipeout " . a:bufNum
|
call nerdtree#exec("confirm bwipeout " . a:bufNum, 0)
|
||||||
catch
|
catch
|
||||||
" This happens when answering Cancel if confirmation is needed. Do nothing.
|
" This happens when answering Cancel if confirmation is needed. Do nothing.
|
||||||
endtry
|
endtry
|
||||||
|
|||||||
Reference in New Issue
Block a user