Check g:startify_session_persistence on VimLeave

Closes #274.
This commit is contained in:
Marco Hinz 2017-02-25 22:35:04 +01:00
parent 967ea449f5
commit b7398c8135
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F

View file

@ -12,11 +12,7 @@ let g:startify_locked = 0
augroup startify
autocmd VimEnter * nested call s:genesis()
if get(g:, 'startify_session_persistence')
autocmd VimLeave * call s:extinction()
endif
autocmd VimLeave * call s:extinction()
autocmd QuickFixCmdPre *vimgrep* let g:startify_locked = 1
autocmd QuickFixCmdPost *vimgrep* let g:startify_locked = 0
augroup END
@ -49,7 +45,9 @@ function! s:genesis()
endfunction
function! s:extinction()
if exists('v:this_session') && filewritable(v:this_session)
if get(g:, 'startify_session_persistence')
\ && exists('v:this_session')
\ && filewritable(v:this_session)
call startify#session_write(fnameescape(v:this_session))
endif
endfunction