Compare commits

..

3 Commits

Author SHA1 Message Date
rzvxa
9b465acb27 chore: bump version to 7.1.3. (#1414) 2024-07-20 08:31:16 +03:30
Lothar Droppelmann
09aec2cfca fix: typo in docs for show file lines setting (#1426)
Co-authored-by: Lothar Droppelmann <lothar.droppelmann@gmail.com>
2024-07-20 08:20:24 +03:30
Ali Rezvani
fbb71fcd90 docs: update FAQ snippets containing quit command. (#1417) 2024-05-14 19:09:02 +03:30
6 changed files with 30 additions and 22 deletions

View File

@@ -13,6 +13,10 @@
- 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)

View File

@@ -150,6 +150,24 @@ 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

View File

@@ -1073,7 +1073,7 @@ mapping and is useful for drastically shrinking the tree when you are
navigating to a different part of the tree.
------------------------------------------------------------------------------
*NERDTreeShowFilesLines*
*NERDTreeFileLines*
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 NERDTreeShowFilesLines=0
let NERDTreeShowFilesLines=1
let NERDTreeFileLines=0
let NERDTreeFileLines=1
<
------------------------------------------------------------------------------
*NERDTreeShowHidden*

View File

@@ -62,11 +62,7 @@ function! s:Path.cacheDisplayString() abort
endif
if self.isSymLink
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
let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' -> ' . self.symLinkDest
endif
if !self.isDirectory && b:NERDTree.ui.getShowFileLines() != 0
@@ -611,33 +607,24 @@ function! s:Path.readInfoFromDisk(fullpath)
let fullpath = s:Path.WinToUnixPath(a:fullpath)
let ftype = getftype(fullpath)
if ftype ==# 'fifo'
if getftype(fullpath) ==# '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 && !self.isBroken
if !self.isDirectory
let self.isExecutable = getfperm(a:fullpath) =~# 'x'
endif

View File

@@ -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, 1)
let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1, 0)
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'))

View File

@@ -71,7 +71,6 @@ 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")