From 6e60ecfee10d25658db33b47e88e859c86079085 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Fri, 6 Jun 2008 23:19:28 +1200 Subject: [PATCH] check for nonexistent marks --- plugin/NERD_tree.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 16e7566..db1308d 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -2864,7 +2864,13 @@ endfunction " FUNCTION: s:RecallMark(name) {{{2 " put the cursor on the node associate with the given name function! s:RecallMark(name) - let mark = s:GetMarks()[a:name] + try + let mark = s:GetMarks()[a:name] + catch /E716/ "key not in dictionary error + call s:Echo("Invalid mark name") + return + endtry + let targetNode = t:NERDTreeRoot.FindNode(mark) call s:PutCursorOnNode(targetNode, 0, 1) endfunction