mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
Compare commits
2 Commits
master
...
broken-sym
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62884a4005 | ||
|
|
9eeacfd04b |
@@ -13,10 +13,6 @@
|
||||
- Pull Request Title n (PR Author) [PR Number](Link to PR)
|
||||
-->
|
||||
#### 7.1
|
||||
- **.3**:
|
||||
- docs: update FAQ snippets containing quit command. (rzvxa) [#1417](https://github.com/preservim/nerdtree/pull/1417)
|
||||
- feat: jump to bookmark table shortcut. (ds2606, rzvxa) [#1394](https://github.com/preservim/nerdtree/pull/1394)
|
||||
- fix: typo in docs for show file lines setting. (lothardp) [#1426](https://github.com/preservim/nerdtree/pull/1426)
|
||||
- **.2**:
|
||||
- fix: GetWinNum regex pattern. (rzvxa) [#1409](https://github.com/preservim/nerdtree/pull/1409)
|
||||
- fix: session restore for nerdtree buffers. (rzvxa) [#1405](https://github.com/preservim/nerdtree/pull/1405)
|
||||
|
||||
@@ -87,7 +87,7 @@ After installing NERDTree, the best way to learn it is to turn on the Quick Help
|
||||
NERDTree can be extended with custom mappings and functions using its built-in API. The details of this API are described in the included documentation. Several plugins have been written, and are available on Github for installation like any other plugin. The plugins in this list are maintained (or not) by their respective owners, and certain combinations may be incompatible.
|
||||
|
||||
* [Xuyuanp/nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin): Shows Git status flags for files and folders in NERDTree.
|
||||
* [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons): Adds filetype-specific icons to NERDTree files and folders.
|
||||
* [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons): Adds filetype-specific icons to NERDTree files and folders,
|
||||
* [tiagofumo/vim-nerdtree-syntax-highlight](https://github.com/tiagofumo/vim-nerdtree-syntax-highlight): Adds syntax highlighting to NERDTree based on filetype.
|
||||
* [scrooloose/nerdtree-project-plugin](https://github.com/scrooloose/nerdtree-project-plugin): Saves and restores the state of the NERDTree between sessions.
|
||||
* [PhilRunninger/nerdtree-buffer-ops](https://github.com/PhilRunninger/nerdtree-buffer-ops): 1) Highlights open files in a different color. 2) Closes a buffer directly from NERDTree.
|
||||
@@ -150,24 +150,6 @@ autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in
|
||||
|
||||
### How can I close Vim or a tab automatically when NERDTree is the last window?
|
||||
|
||||
Because of the changes in how Vim handles its `autocmd` and layout locking `quit` command is no longer available in Vim9 auto commands, Depending on which version you're running select one of these solutions.
|
||||
|
||||
__NeoVim users should be able to choose either one of them!__
|
||||
|
||||
#### Vim9
|
||||
|
||||
```vim
|
||||
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
||||
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | call feedkeys(":quit\<CR>:\<BS>") | endif
|
||||
```
|
||||
---
|
||||
```vim
|
||||
" Close the tab if NERDTree is the only window remaining in it.
|
||||
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | call feedkeys(":quit\<CR>:\<BS>") | endif
|
||||
```
|
||||
|
||||
#### Vim8 or older
|
||||
|
||||
```vim
|
||||
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
||||
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
||||
|
||||
@@ -1073,7 +1073,7 @@ mapping and is useful for drastically shrinking the tree when you are
|
||||
navigating to a different part of the tree.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*NERDTreeFileLines*
|
||||
*NERDTreeShowFilesLines*
|
||||
Values: 0 or 1.
|
||||
Default: 0.
|
||||
|
||||
@@ -1083,8 +1083,8 @@ file.
|
||||
This setting can be toggled dynamically, per tree, with the |NERDTree-FL|
|
||||
mapping.
|
||||
Use one of the follow lines for this setting: >
|
||||
let NERDTreeFileLines=0
|
||||
let NERDTreeFileLines=1
|
||||
let NERDTreeShowFilesLines=0
|
||||
let NERDTreeShowFilesLines=1
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
*NERDTreeShowHidden*
|
||||
|
||||
@@ -62,7 +62,11 @@ function! s:Path.cacheDisplayString() abort
|
||||
endif
|
||||
|
||||
if self.isSymLink
|
||||
let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' -> ' . self.symLinkDest
|
||||
let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' -> '
|
||||
let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . self.symLinkDest
|
||||
if self.isBroken
|
||||
let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . g:NERDTreeGlyphBroken
|
||||
endif
|
||||
endif
|
||||
|
||||
if !self.isDirectory && b:NERDTree.ui.getShowFileLines() != 0
|
||||
@@ -362,10 +366,9 @@ endfunction
|
||||
" returns the index of the pattern in g:NERDTreeSortOrder that this path matches
|
||||
function! s:Path.getSortOrderIndex()
|
||||
let i = 0
|
||||
let l:lpc = self.getLastPathComponent(1)
|
||||
while i < len(g:NERDTreeSortOrder)
|
||||
if g:NERDTreeSortOrder[i] !~? '\[\[-\?\(timestamp\|size\|extension\)\]\]' &&
|
||||
\ l:lpc =~# g:NERDTreeSortOrder[i]
|
||||
\ self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i]
|
||||
return i
|
||||
endif
|
||||
let i = i + 1
|
||||
@@ -608,24 +611,33 @@ function! s:Path.readInfoFromDisk(fullpath)
|
||||
|
||||
let fullpath = s:Path.WinToUnixPath(a:fullpath)
|
||||
|
||||
if getftype(fullpath) ==# 'fifo'
|
||||
let ftype = getftype(fullpath)
|
||||
|
||||
if ftype ==# 'fifo'
|
||||
throw 'NERDTree.InvalidFiletypeError: Cant handle FIFO files: ' . a:fullpath
|
||||
endif
|
||||
|
||||
let self.pathSegments = filter(split(fullpath, '/'), '!empty(v:val)')
|
||||
|
||||
let self.isReadOnly = 0
|
||||
if isdirectory(a:fullpath)
|
||||
let self.isDirectory = 1
|
||||
let self.isReadOnly = 0
|
||||
let self.isBroken = 0
|
||||
elseif filereadable(a:fullpath)
|
||||
let self.isDirectory = 0
|
||||
let self.isReadOnly = filewritable(a:fullpath) ==# 0
|
||||
let self.isBroken = 0
|
||||
elseif ftype ==# 'link'
|
||||
let self.isDirectory = 0
|
||||
let self.isReadOnly = 0
|
||||
let self.isBroken = 1
|
||||
else
|
||||
call nerdtree#echoWarning('invalid ' . a:fullpath . 'file type: ' . ftype)
|
||||
throw 'NERDTree.InvalidArgumentsError: Invalid path = ' . a:fullpath
|
||||
endif
|
||||
|
||||
let self.isExecutable = 0
|
||||
if !self.isDirectory
|
||||
if !self.isDirectory && !self.isBroken
|
||||
let self.isExecutable = getfperm(a:fullpath) =~# 'x'
|
||||
endif
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ function! s:TreeDirNode._glob(pattern, all)
|
||||
" See ':h version7.txt' and ':h version8.txt' for details on the
|
||||
" development of the glob() and globpath() functions.
|
||||
if v:version > 704 || (v:version ==# 704 && has('patch654'))
|
||||
let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1, 0)
|
||||
let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1, 1)
|
||||
elseif v:version ==# 704 && has('patch279')
|
||||
let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1)
|
||||
elseif v:version > 702 || (v:version ==# 702 && has('patch051'))
|
||||
@@ -591,7 +591,6 @@ function! s:TreeDirNode.refresh()
|
||||
let newNode = g:NERDTreeFileNode.New(path, self.getNerdtree())
|
||||
let newNode.parent = self
|
||||
call add(newChildNodes, newNode)
|
||||
call g:NERDTreePathNotifier.NotifyListeners('init', newNode.path, newNode.getNerdtree(), {})
|
||||
endif
|
||||
catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
|
||||
let invalidFilesFound += 1
|
||||
@@ -716,7 +715,6 @@ function! s:TreeDirNode.transplantChild(newNode)
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
call self.refresh()
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
||||
@@ -211,7 +211,6 @@ function! NERDTreeAddNode()
|
||||
call b:NERDTree.render()
|
||||
elseif parentNode.isOpen || !empty(parentNode.children)
|
||||
call parentNode.addChild(newTreeNode, 1)
|
||||
call g:NERDTreePathNotifier.NotifyListeners('init', newTreeNode.path, newTreeNode.getNerdtree(), {})
|
||||
call NERDTreeRender()
|
||||
call newTreeNode.putCursorHere(1, 0)
|
||||
endif
|
||||
|
||||
@@ -71,6 +71,7 @@ let g:NERDTreeSortOrder = get(g:, 'NERDTreeSortOrder', ['\/$', '*', '\.swp$',
|
||||
let g:NERDTreeOldSortOrder = []
|
||||
|
||||
let g:NERDTreeGlyphReadOnly = get(g:, 'NERDTreeGlyphReadOnly', 'RO')
|
||||
let g:NERDTreeGlyphBroken = get(g:, 'NERDTreeGlyphBroken', ' [*broken]')
|
||||
|
||||
if has('conceal')
|
||||
let g:NERDTreeNodeDelimiter = get(g:, 'NERDTreeNodeDelimiter', "\x07")
|
||||
|
||||
Reference in New Issue
Block a user