mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 19:33:50 -05:00
Compare commits
2 Commits
7.1.3
...
broken-sym
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62884a4005 | ||
|
|
9eeacfd04b |
@@ -13,10 +13,6 @@
|
|||||||
- Pull Request Title n (PR Author) [PR Number](Link to PR)
|
- Pull Request Title n (PR Author) [PR Number](Link to PR)
|
||||||
-->
|
-->
|
||||||
#### 7.1
|
#### 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**:
|
- **.2**:
|
||||||
- fix: GetWinNum regex pattern. (rzvxa) [#1409](https://github.com/preservim/nerdtree/pull/1409)
|
- 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)
|
- fix: session restore for nerdtree buffers. (rzvxa) [#1405](https://github.com/preservim/nerdtree/pull/1405)
|
||||||
|
|||||||
@@ -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?
|
### 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
|
```vim
|
||||||
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
" 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
|
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.
|
navigating to a different part of the tree.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDTreeFileLines*
|
*NERDTreeShowFilesLines*
|
||||||
Values: 0 or 1.
|
Values: 0 or 1.
|
||||||
Default: 0.
|
Default: 0.
|
||||||
|
|
||||||
@@ -1083,8 +1083,8 @@ file.
|
|||||||
This setting can be toggled dynamically, per tree, with the |NERDTree-FL|
|
This setting can be toggled dynamically, per tree, with the |NERDTree-FL|
|
||||||
mapping.
|
mapping.
|
||||||
Use one of the follow lines for this setting: >
|
Use one of the follow lines for this setting: >
|
||||||
let NERDTreeFileLines=0
|
let NERDTreeShowFilesLines=0
|
||||||
let NERDTreeFileLines=1
|
let NERDTreeShowFilesLines=1
|
||||||
<
|
<
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDTreeShowHidden*
|
*NERDTreeShowHidden*
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ function! s:Path.cacheDisplayString() abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if self.isSymLink
|
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
|
endif
|
||||||
|
|
||||||
if !self.isDirectory && b:NERDTree.ui.getShowFileLines() != 0
|
if !self.isDirectory && b:NERDTree.ui.getShowFileLines() != 0
|
||||||
@@ -607,24 +611,33 @@ function! s:Path.readInfoFromDisk(fullpath)
|
|||||||
|
|
||||||
let fullpath = s:Path.WinToUnixPath(a: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
|
throw 'NERDTree.InvalidFiletypeError: Cant handle FIFO files: ' . a:fullpath
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let self.pathSegments = filter(split(fullpath, '/'), '!empty(v:val)')
|
let self.pathSegments = filter(split(fullpath, '/'), '!empty(v:val)')
|
||||||
|
|
||||||
let self.isReadOnly = 0
|
|
||||||
if isdirectory(a:fullpath)
|
if isdirectory(a:fullpath)
|
||||||
let self.isDirectory = 1
|
let self.isDirectory = 1
|
||||||
|
let self.isReadOnly = 0
|
||||||
|
let self.isBroken = 0
|
||||||
elseif filereadable(a:fullpath)
|
elseif filereadable(a:fullpath)
|
||||||
let self.isDirectory = 0
|
let self.isDirectory = 0
|
||||||
let self.isReadOnly = filewritable(a:fullpath) ==# 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
|
else
|
||||||
|
call nerdtree#echoWarning('invalid ' . a:fullpath . 'file type: ' . ftype)
|
||||||
throw 'NERDTree.InvalidArgumentsError: Invalid path = ' . a:fullpath
|
throw 'NERDTree.InvalidArgumentsError: Invalid path = ' . a:fullpath
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let self.isExecutable = 0
|
let self.isExecutable = 0
|
||||||
if !self.isDirectory
|
if !self.isDirectory && !self.isBroken
|
||||||
let self.isExecutable = getfperm(a:fullpath) =~# 'x'
|
let self.isExecutable = getfperm(a:fullpath) =~# 'x'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ function! s:TreeDirNode._glob(pattern, all)
|
|||||||
" See ':h version7.txt' and ':h version8.txt' for details on the
|
" See ':h version7.txt' and ':h version8.txt' for details on the
|
||||||
" development of the glob() and globpath() functions.
|
" development of the glob() and globpath() functions.
|
||||||
if v:version > 704 || (v:version ==# 704 && has('patch654'))
|
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')
|
elseif v:version ==# 704 && has('patch279')
|
||||||
let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1)
|
let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1)
|
||||||
elseif v:version > 702 || (v:version ==# 702 && has('patch051'))
|
elseif v:version > 702 || (v:version ==# 702 && has('patch051'))
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ let g:NERDTreeSortOrder = get(g:, 'NERDTreeSortOrder', ['\/$', '*', '\.swp$',
|
|||||||
let g:NERDTreeOldSortOrder = []
|
let g:NERDTreeOldSortOrder = []
|
||||||
|
|
||||||
let g:NERDTreeGlyphReadOnly = get(g:, 'NERDTreeGlyphReadOnly', 'RO')
|
let g:NERDTreeGlyphReadOnly = get(g:, 'NERDTreeGlyphReadOnly', 'RO')
|
||||||
|
let g:NERDTreeGlyphBroken = get(g:, 'NERDTreeGlyphBroken', ' [*broken]')
|
||||||
|
|
||||||
if has('conceal')
|
if has('conceal')
|
||||||
let g:NERDTreeNodeDelimiter = get(g:, 'NERDTreeNodeDelimiter', "\x07")
|
let g:NERDTreeNodeDelimiter = get(g:, 'NERDTreeNodeDelimiter', "\x07")
|
||||||
|
|||||||
Reference in New Issue
Block a user