Compare commits

..

5 Commits

Author SHA1 Message Date
lifecrisis
4cc6097ecb Do not consider the tree root to be "cascadable" (#1120)
* Do not consider the tree root to be "cascadable"

* Update "CHANGELOG.md"
2020-05-06 23:24:01 -04:00
Phil Runninger
30ad6da984 Force NERDTreeFocus to allow events to be fired when switching windows. (#1118) 2020-05-04 08:14:22 -04:00
Phil Runninger
3005a0e9c0 Update version number in change log. 2020-05-04 08:11:49 -04:00
Phil Runninger
a7d585f7af Force NERDTreeFocus to allow events to be fired when switching windows. 2020-05-04 07:59:25 -04:00
Phil Runninger
5e77fb2fef Fix example code for the NERDTreeAddKeyMap function. (#1116)
* Fix example code for the NERDTreeAddKeyMap function.

The quickhelpText didn't match what the statement in the callback
function actually did.

* Update version number in change log.
2020-05-03 01:21:34 -04:00
5 changed files with 16 additions and 7 deletions

View File

@@ -5,7 +5,10 @@
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR) - **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
--> -->
#### 6.7 #### 6.7
- **.7**: Put '%' argument in bufname() for backwards compatibility. (PhilRunninger) [#1105](https://github.com/preservim/nerdtree/pull/1105) - **.10**: Do not consider the tree root to be "cascadable". (lifecrisis) [#1120](https://github.com/preservim/nerdtree/pull/1120)
- **.9**: Force `:NERDTreeFocus` to allow events to be fired when switching windows. (PhilRunninger) [#1118](https://github.com/preservim/nerdtree/pull/1118)
- **.8**: Fix example code for the `NERDTreeAddKeyMap()` function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116)
- **.7**: Put `'%'` argument in `bufname()` for backwards compatibility. (PhilRunninger) [#1105](https://github.com/preservim/nerdtree/pull/1105)
- **.6**: If a file's already open in the window, don't edit it again. (PhilRunninger) [#1103](https://github.com/preservim/nerdtree/pull/1103) - **.6**: If a file's already open in the window, don't edit it again. (PhilRunninger) [#1103](https://github.com/preservim/nerdtree/pull/1103)
- **.5**: Prevent unneeded tree creation in `:NERDTreeToggle[VCS] <path>` (PhilRunninger) [#1101](https://github.com/preservim/nerdtree/pull/1101) - **.5**: Prevent unneeded tree creation in `:NERDTreeToggle[VCS] <path>` (PhilRunninger) [#1101](https://github.com/preservim/nerdtree/pull/1101)
- **.4**: Add missing calls to the `shellescape()` function (lifecrisis) [#1099](https://github.com/preservim/nerdtree/pull/1099) - **.4**: Add missing calls to the `shellescape()` function (lifecrisis) [#1099](https://github.com/preservim/nerdtree/pull/1099)

View File

@@ -1353,12 +1353,12 @@ NERDTreeAddKeyMap({options}) *NERDTreeAddKeyMap()*
Example: > Example: >
call NERDTreeAddKeyMap({ call NERDTreeAddKeyMap({
\ 'key': 'foo', \ 'key': 'foo',
\ 'callback': 'NERDTreeCDHandler', \ 'callback': 'NERDTreeEchoPathHandler',
\ 'quickhelpText': 'echo full path of current node', \ 'quickhelpText': 'echo full path of current node',
\ 'scope': 'DirNode' }) \ 'scope': 'DirNode' })
function! NERDTreeCDHandler(dirnode) function! NERDTreeEchoPathHandler(dirnode)
call a:dirnode.changeToDir() echo a:dirnode.path.str()
endfunction endfunction
< <
This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim. This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim.

View File

@@ -96,9 +96,9 @@ endfunction
"FUNCTION: s:NERDTree.CursorToTreeWin(){{{1 "FUNCTION: s:NERDTree.CursorToTreeWin(){{{1
"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', 1) call nerdtree#exec(g:NERDTree.GetWinNum() . 'wincmd w', a:0 >0 ? a:1 : 1)
endfunction endfunction
" Function: s:NERDTree.ExistsForBuffer() {{{1 " Function: s:NERDTree.ExistsForBuffer() {{{1

View File

@@ -377,11 +377,17 @@ endfunction
" 1. If cascaded, we don't know which dir is bookmarked or is a symlink. " 1. If cascaded, we don't know which dir is bookmarked or is a symlink.
" 2. If the parent is a symlink or is bookmarked, you end up with unparsable " 2. If the parent is a symlink or is bookmarked, you end up with unparsable
" text, and NERDTree cannot get the path of any child node. " text, and NERDTree cannot get the path of any child node.
" Also, return false if this directory is the tree root, which should never be
" part of a cascade.
function! s:TreeDirNode.isCascadable() function! s:TreeDirNode.isCascadable()
if g:NERDTreeCascadeSingleChildDir ==# 0 if g:NERDTreeCascadeSingleChildDir ==# 0
return 0 return 0
endif endif
if self.isRoot()
return 0
endif
if self.path.isSymLink if self.path.isSymLink
return 0 return 0
endif endif

View File

@@ -217,7 +217,7 @@ endfunction
function! NERDTreeFocus() function! NERDTreeFocus()
if g:NERDTree.IsOpen() if g:NERDTree.IsOpen()
call g:NERDTree.CursorToTreeWin() call g:NERDTree.CursorToTreeWin(0)
else else
call g:NERDTreeCreator.ToggleTabTree('') call g:NERDTreeCreator.ToggleTabTree('')
endif endif