nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit b3804dcd71471505048c8a75f301539fc2dce081
parent 15d06b676dfcd92ac9a0bc375668d127f9822539
Author: Phil Runninger <PhilRunninger@users.noreply.github.com>
Date:   Mon, 10 Sep 2018 17:34:06 -0400

Merge pull request #871 from scrooloose/trap_bad_bookmark_path

Make sure the path to the bookmarks file exists before writing it.
Diffstat:
Mlib/nerdtree/bookmark.vim | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/nerdtree/bookmark.vim b/lib/nerdtree/bookmark.vim
@@ -343,7 +343,12 @@ function! s:Bookmark.Write()
     for j in s:Bookmark.InvalidBookmarks()
         call add(bookmarkStrings, j)
     endfor
-    call writefile(bookmarkStrings, g:NERDTreeBookmarksFile)
+
+    try
+        call writefile(bookmarkStrings, g:NERDTreeBookmarksFile)
+    catch
+        call nerdtree#echoError("Failed to write bookmarks file. Make sure g:NERDTreeBookmarksFile points to a valid location.")
+    endtry
 endfunction
 
 " vim: set sw=4 sts=4 et fdm=marker: