mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-10 04:13:48 -05:00
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:
@@ -343,7 +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
|
||||||
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
|
endfunction
|
||||||
|
|
||||||
" vim: set sw=4 sts=4 et fdm=marker:
|
" vim: set sw=4 sts=4 et fdm=marker:
|
||||||
|
|||||||
Reference in New Issue
Block a user