nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 5e77fb2fef6720eabbfe957cf3a47f3f0a218e05
parent 29a321d061032df5b2ec347b6b4b778f665305a6
Author: Phil Runninger <PhilRunninger@users.noreply.github.com>
Date:   Sun,  3 May 2020 01:21:34 -0400

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.
Diffstat:
MCHANGELOG.md | 1+
Mdoc/NERDTree.txt | 6+++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
@@ -5,6 +5,7 @@
         - **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
 -->
 #### 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)
 - **.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)
diff --git a/doc/NERDTree.txt b/doc/NERDTree.txt
@@ -1353,12 +1353,12 @@ NERDTreeAddKeyMap({options})                               *NERDTreeAddKeyMap()*
     Example: >
         call NERDTreeAddKeyMap({
                \ 'key': 'foo',
-               \ 'callback': 'NERDTreeCDHandler',
+               \ 'callback': 'NERDTreeEchoPathHandler',
                \ 'quickhelpText': 'echo full path of current node',
                \ 'scope': 'DirNode' })
 
-        function! NERDTreeCDHandler(dirnode)
-            call a:dirnode.changeToDir()
+        function! NERDTreeEchoPathHandler(dirnode)
+            echo a:dirnode.path.str()
         endfunction
 <
     This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim.