nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 995f7faec3aa0e2e7fa3fceb2ac50e0c112f440a
parent 140deac284ab2a5f5463a3886f6d15ae2ba9fc26
Author: Martin Grenfell <martin_grenfell@msn.com>
Date:   Sun,  8 Jun 2008 19:16:38 +1200

only attempt to open marks file if it exists

Diffstat:
Mplugin/NERD_tree.vim | 18++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -1439,14 +1439,16 @@ endfunction
 
 " Function: s:ReadMarks()   {{{2
 function! s:ReadMarks()
-    let marks = s:GetMarks()
-    let markStrings = readfile(g:NERDTreeMarksFile)
-    for i in markStrings
-        let key = substitute(i, '^\(\w.\{-}\) .*$', '\1', '')
-        let path = substitute(i, '^\w.\{-} \(.*\)$', '\1', '')
-        let marks[key] = s:oPath.New(path)
-    endfor
-    call s:RenderView()
+    if filereadable(g:NERDTreeMarksFile)
+        let marks = s:GetMarks()
+        let markStrings = readfile(g:NERDTreeMarksFile)
+        for i in markStrings
+            let key = substitute(i, '^\(\w.\{-}\) .*$', '\1', '')
+            let path = substitute(i, '^\w.\{-} \(.*\)$', '\1', '')
+            let marks[key] = s:oPath.New(path)
+        endfor
+        call s:RenderView()
+    endif
 endfunction
 " Function: s:TreeExistsForTab()   {{{2
 " Returns 1 if a nerd tree root exists in the current tab