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.
This commit is contained in:
Phil Runninger 2020-05-03 01:21:34 -04:00 committed by GitHub
parent 29a321d061
commit 5e77fb2fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,7 @@
- **.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
- **.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) - **.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)

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.