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
This commit is contained in:
Martin Grenfell 2008-06-08 21:07:13 +12:00
parent 6334e99192
commit c63e183acf

View File

@ -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