Make sure the path to the bookmarks file exists before writing it.

This commit is contained in:
Phil Runninger (mac) 2018-08-07 18:13:40 -04:00
parent e653a68270
commit 7d9a3f0e8b

View File

@ -343,6 +343,12 @@ function! s:Bookmark.Write()
for j in s:Bookmark.InvalidBookmarks() for j in s:Bookmark.InvalidBookmarks()
call add(bookmarkStrings, j) call add(bookmarkStrings, j)
endfor endfor
let path = fnamemodify(g:NERDTreeBookmarksFile, ':h')
if !isdirectory(path)
call mkdir(path, 'p')
endif
call writefile(bookmarkStrings, g:NERDTreeBookmarksFile) call writefile(bookmarkStrings, g:NERDTreeBookmarksFile)
endfunction endfunction