Closed eight04 closed 2 years ago
@eight04 I personally don't use this feature, however, this was designed to work specifically along with g:prosession_last_session_dir
setting. The idea is for that directory we save and restore session in a custom way. I believe we can't rely on obsession for saving this at this stage.
Did you encounter an issue with this ? Can you please elaborate more on that ? Kindly share your thoughts / suggestions on this.
I set g:prosession_last_session_dir
to ~
so gVim loads the last session automatically at startup. Did I misunderstand how this option works?
@eight04 No, that is right, although accidental because gVim always starts with ~
as the current directory. If you start gVim manually from the terminal while being in a different directory this does not apply.
How about changing mksession
to something like this?
call writefile(["source ".path_to_current_session], path_to_last_session)
Though it won't work when path_to_current_session == path_to_last_session
.
@eight04 I'll take a look, thanks for your suggestion.
https://github.com/dhruvasagar/vim-prosession/blob/976f3e61c2dd4ab709ea5eccbbab9e42d35d7e8c/plugin/prosession.vim#L207 This behavior is inconsistent with Obsession: https://github.com/tpope/vim-obsession/blob/82c9ac5e130c92a46e043dd9cd9e5b48d15e286d/plugin/obsession.vim#L76-L78