From 7d9a3f0e8b1546c81e9a3591c416313f0dffd936 Mon Sep 17 00:00:00 2001 From: "Phil Runninger (mac)" Date: Tue, 7 Aug 2018 18:13:40 -0400 Subject: [PATCH] Make sure the path to the bookmarks file exists before writing it. --- lib/nerdtree/bookmark.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/nerdtree/bookmark.vim b/lib/nerdtree/bookmark.vim index dd69ad0..55abc8c 100644 --- a/lib/nerdtree/bookmark.vim +++ b/lib/nerdtree/bookmark.vim @@ -343,6 +343,12 @@ function! s:Bookmark.Write() for j in s:Bookmark.InvalidBookmarks() call add(bookmarkStrings, j) endfor + + let path = fnamemodify(g:NERDTreeBookmarksFile, ':h') + if !isdirectory(path) + call mkdir(path, 'p') + endif + call writefile(bookmarkStrings, g:NERDTreeBookmarksFile) endfunction