Merge pull request #871 from scrooloose/trap_bad_bookmark_path

Make sure the path to the bookmarks file exists before writing it.
This commit is contained in:
Phil Runninger
2018-09-10 17:34:06 -04:00
committed by GitHub

View File

@@ -343,7 +343,12 @@ function! s:Bookmark.Write()
for j in s:Bookmark.InvalidBookmarks()
call add(bookmarkStrings, j)
endfor
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: