From c6064921cfad1bba68d0cd3efdb4c764773b55d5 Mon Sep 17 00:00:00 2001 From: Dylan Chong Date: Tue, 19 Jun 2018 22:40:46 +1200 Subject: [PATCH] Add option for session_autosave_only_with_explicit_session --- autoload/xolox/session.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/xolox/session.vim b/autoload/xolox/session.vim index 1f58004..fb1d157 100644 --- a/autoload/xolox/session.vim +++ b/autoload/xolox/session.vim @@ -458,6 +458,10 @@ function! xolox#session#auto_save() " {{{2 if empty(name) " Get the name of the active session (if any). let name = xolox#session#find_current_session() + " If the user doesn't want to autosave when there is no session, then stop. + if empty(name) && get(g:, 'session_autosave_only_with_explicit_session', 0) == 1 + return + endif " If no session is active and the user doesn't have any sessions yet, " help them get started by suggesting to create the default session. if empty(name) && (empty(xolox#session#get_names(0)) || g:session_default_overwrite)