Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto_save only if there is an open session. #90

Open
anirudhaku opened this issue Mar 25, 2014 · 6 comments · May be fixed by #175
Open

auto_save only if there is an open session. #90

anirudhaku opened this issue Mar 25, 2014 · 6 comments · May be fixed by #175

Comments

@anirudhaku
Copy link

Currently, even if there is no session open, either default session is saved or user is prompted (depending of auto_save = 'yes' or 'prompt'). Is it possible to ignore auto_save if there is no open session?

Use Case:
If user goes to a directory and opens a file just to read it, then there is no need to save the session. If user intends to maintain a session for a particular directory (e.g. directory contains a project user is working on) then he can 'SaveSession' once and then auto_save will kick in on every subsequent exit.

@anirudhaku
Copy link
Author

Any thoughts???

@leira
Copy link

leira commented Jun 24, 2014

It's the exactly same thought I have when the very first time when I saw the prompt.

@subhojit777
Copy link

this would be a very good feature 👍

@cpixl
Copy link
Contributor

cpixl commented Feb 21, 2015

Currently I'm having the same problem... I really wish there could be some option to disable auto_save only when there was no active session.

@cpixl
Copy link
Contributor

cpixl commented Feb 21, 2015

Looking on the source code, it looks like this is partially the current behaviour. The xolox#session#auto_save_periodic function will only save if there's some session open (#L478), and the xolox#session#auto_save function will only save the "default" session if there isn't any other saved session AND the g:session_default_overwrite option is not set (#L444).

Anyway, I guess this behaviour could be better documented.

@dylan-chong
Copy link

I will be adding my own fix to this branch here https://github.com/dylan-chong/vim-session/commits/session_autosave_only_with_explicit_session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants