From 5939fdb14077863e2f32728c46d7efc8c4f30eb6 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sun, 13 Jul 2008 21:03:33 +1200 Subject: [PATCH] add s:ValidateBookmark() --- plugin/NERD_tree.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 2b40f86..d41e6a6 100755 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -2789,6 +2789,17 @@ function! s:Toggle(dir) call s:InitNerdTree(a:dir) endif endfunction + +"FUNCTION: s:ValidateBookmark(bookmark) {{{2 +function! s:ValidateBookmark(bookmark) + try + call a:bookmark.MustExist() + catch /NERDTree.BookmarkPointsToInvalidLocation/ + call s:RenderView() + throw v:exception + endtry +endfunction + "SECTION: Interface bindings {{{1 "============================================================ "FUNCTION: s:ActivateNode(forceKeepWindowOpen) {{{2