From c63e183acfe581972861c99cec8ee17e8483272e Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sun, 8 Jun 2008 21:07:13 +1200 Subject: [PATCH] make OpenMark open the mark even if its not cached if OpenMark is called for a mark for a file that isnt cached in the tree, just open the file anyway and dont put attempt to put the cursor on it etc --- plugin/NERD_tree.vim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 2eafc8f..6e87a54 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -2921,9 +2921,15 @@ endfunction " FUNCTION: s:OpenMark(name) {{{2 " put the cursor on the given mark and, if its a file, open it function! s:OpenMark(name) - let targetNode = s:GetNodeForMark(a:name, 0) - call s:PutCursorOnNode(targetNode, 0, 1) - redraw! + try + let targetNode = s:GetNodeForMark(a:name, 0) + call s:PutCursorOnNode(targetNode, 0, 1) + redraw! + catch /NERDTree.MarkNotFound/ + call s:Echo("note - target node is not cached") + let marks = s:GetMarks() + let targetNode = s:oTreeFileNode.New(marks[a:name]) + endtry if !targetNode.path.isDirectory call s:OpenFileNode(targetNode) endif