Skip to content

Changelog update #1377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/vint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v3
- name: Run vint with reviewdog
uses: reviewdog/action-vint@v1.0.1
uses: reviewdog/action-vint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
version in an unordered list. The format is:
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
-->
#### 7.0
- **.3**: Now we warn about invalid files instead of ignoring them silently. (rmonico) [#1365](https://github.com/preservim/nerdtree/pull/1365)
- **.2**: New g:NERDTreeWinPos options for top and bottom. (rzvxa) [#1363](https://github.com/preservim/nerdtree/pull/1363)
- **.1**: Fix error in README. (nickspoons) [#1330](https://github.com/preservim/nerdtree/pull/1330)
- **.0**: Fix typo in the documentation. (chapeupreto) [#1306](https://github.com/preservim/nerdtree/pull/1306)
#### 6.10
- **.16**: Fix documentation errors. (lifecrisis) [#1269](https://github.com/preservim/nerdtree/pull/1269)
- **.15**: Ensure backward compatible testing of types. (lifecrisis) [#1266](https://github.com/preservim/nerdtree/pull/1266)
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_

```vim
" Open the existing NERDTree on each new tab.
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
autocmd BufWinEnter * if &buftype != 'quickfix' && getcmdwintype() == '' | silent NERDTreeMirror | endif
```
or change your NERDTree-launching shortcut key like so:
```vim
Expand Down
9 changes: 8 additions & 1 deletion doc/NERDTree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ setting is used.

------------------------------------------------------------------------------
*NERDTreeWinPos*
Values: "left" or "right"
Values: "left", "right", "top" or "bottom"
Default: "left".

This setting is used to determine where NERDTree window is placed on the
Expand All @@ -1138,6 +1138,13 @@ This setting makes it possible to use two different explorer plugins
simultaneously. For example, you could have the taglist plugin on the left of
the window and the NERDTree on the right.

When setting this variable to "top" or "bottom" make sure to also change the
|NERDTreeWinSize| to a more reasonable size.

For example:
>
let g:NERDTreeWinSize = 15
<
------------------------------------------------------------------------------
*NERDTreeWinSize*
Values: a positive integer.
Expand Down
9 changes: 5 additions & 4 deletions lib/nerdtree/creator.vim
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,17 @@ endfunction
" Initialize the NERDTree window. Open the window, size it properly, set all
" local options, etc.
function! s:Creator._createTreeWin()
let l:splitLocation = g:NERDTreeWinPos ==# 'left' ? 'topleft ' : 'botright '
let l:splitLocation = g:NERDTreeWinPos ==# 'left' || g:NERDTreeWinPos ==# 'top' ? 'topleft ' : 'botright '
let l:splitDirection = g:NERDTreeWinPos ==# 'left' || g:NERDTreeWinPos ==# 'right' ? 'vertical' : ''
let l:splitSize = g:NERDTreeWinSize

if !g:NERDTree.ExistsForTab()
let t:NERDTreeBufName = self._nextBufferName()
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' new'
silent! execute l:splitLocation . l:splitDirection . ' ' . l:splitSize . ' new'
silent! execute 'edit ' . t:NERDTreeBufName
silent! execute 'vertical resize '. l:splitSize
silent! execute l:splitDirection . ' resize '. l:splitSize
else
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' split'
silent! execute l:splitLocation . l:splitDirection . ' ' . l:splitSize . ' split'
silent! execute 'buffer ' . t:NERDTreeBufName
endif

Expand Down
10 changes: 7 additions & 3 deletions lib/nerdtree/tree_dir_node.vim
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,15 @@ function! s:TreeDirNode._initChildren(silent)
endif

let invalidFilesFound = 0
let invalidFiles = []
for i in files
try
let path = g:NERDTreePath.New(i)
call self.createChild(path, 0)
call g:NERDTreePathNotifier.NotifyListeners('init', path, self.getNerdtree(), {})
catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
let invalidFilesFound += 1
let invalidFiles += [i]
endtry
endfor

Expand All @@ -437,7 +439,7 @@ function! s:TreeDirNode._initChildren(silent)
call nerdtree#echo('')

if invalidFilesFound
call nerdtree#echoWarning(invalidFilesFound . ' file(s) could not be loaded into the NERD tree')
call nerdtree#echoWarning(invalidFilesFound . ' Invalid file(s): ' . join(invalidFiles, ', '))
endif
return self.getChildCount()
endfunction
Expand Down Expand Up @@ -564,6 +566,7 @@ function! s:TreeDirNode.refresh()
let files = self._glob('*', 1) + self._glob('.*', 0)
let newChildNodes = []
let invalidFilesFound = 0
let invalidFiles = []
for i in files
try
"create a new path and see if it exists in this nodes children
Expand All @@ -580,7 +583,8 @@ function! s:TreeDirNode.refresh()
call add(newChildNodes, newNode)
endif
catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
let invalidFilesFound = 1
let invalidFilesFound += 1
let invalidFiles += [i]
endtry
endfor

Expand All @@ -589,7 +593,7 @@ function! s:TreeDirNode.refresh()
call self.sortChildren()

if invalidFilesFound
call nerdtree#echoWarning('some files could not be loaded into the NERD tree')
call nerdtree#echoWarning(invalidFilesFound . ' Invalid file(s): ' . join(invalidFiles, ', '))
endif
endif
endfunction
Expand Down