From c0b90811b08b336c4378cff17e0b6af578ae2b18 Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Sat, 10 Jun 2017 11:02:28 -0400 Subject: [PATCH] Add an argument sigil in a Bookmark class method A missing argument sigil is effectively a syntax error in VimL. The function in which the error occurred was called in the execution of at least three buffer-local NERDTree commands: 1. :Bookmark (specifically, when trying to overwrite a Bookmark) 2. :OpenBookmark 3. :RevealBookmark Only one specific type of error message associated with these commands is fixed here (see issue #677). The problems with the above commands are not fully addressed by this commit, and their behavior can be improved immensely by further refactoring. However, no one has been able to even use these commands at all before now because the fix given here was not in place. More work will need to be done to improve the behavior of these commands so that they truly function as any reasonable user would expect. Fixes #677. --- lib/nerdtree/bookmark.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/nerdtree/bookmark.vim b/lib/nerdtree/bookmark.vim index d56407f..bf95621 100644 --- a/lib/nerdtree/bookmark.vim +++ b/lib/nerdtree/bookmark.vim @@ -172,11 +172,13 @@ function! s:Bookmark.getNode(nerdtree, searchFromAbsoluteRoot) endfunction " FUNCTION: Bookmark.GetNodeForName(name, searchFromAbsoluteRoot, nerdtree) {{{1 -" Class method that finds the bookmark with the given name and returns the -" treenode for it. +" Class method that returns the tree node object for the Bookmark with the +" given name. Throws "NERDTree.BookmarkNotFoundError" if a Bookmark with the +" name does not exist. Throws "NERDTree.BookmarkedNodeNotFoundError" if a +" tree node for the named Bookmark could not be found. function! s:Bookmark.GetNodeForName(name, searchFromAbsoluteRoot, nerdtree) - let bookmark = s:Bookmark.BookmarkFor(a:name) - return bookmark.getNode(nerdtree, a:searchFromAbsoluteRoot) + let l:bookmark = s:Bookmark.BookmarkFor(a:name) + return l:bookmark.getNode(a:nerdtree, a:searchFromAbsoluteRoot) endfunction " FUNCTION: Bookmark.GetSelected() {{{1