mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 10:55:15 +08: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:
commit
b3804dcd71
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user