You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My workflow involves using tabs which each have their own working directory set using :tcd.
Right now if I :qa to quit and leave all my tabs intact then auto-session saves to a session based on the cwd of whichever tab I quit from. This would also be an issue if someone used :lcd to set the current working directory of a window.
I can see this is because Lib.escaped_session_name_from_cwd() uses vim.fn.getcwd(). When called with no argument it tries to get the cwd of the window first, if that's not set then the cwd of the tab, if that's not set then the global cwd.
The simple solution is to change the code to use vim.fn.getcwd( -1,-1) which would return the global working directory which only gets changed by using :cd. (This might not be the right place, I had a quick look through the code and this seems like where the cwd is chosen.)
I thought I had configured the plugin incorrectly as every time I left from a tab other than the first one I would lose my session. After looking at all the sessions being saved I figured out what was happening.
The text was updated successfully, but these errors were encountered:
Thanks, I did find that one before posting but the use cases are different. The other issue is using multiple tabs to handle different projects, I'm using tabs to have different directories as the working directory inside a single project.
But after reading that issue again, I think the solution would be the same for both of them, So I'll start posting there.
I'm going to come back to this issue as #76 is different.
Will now replace every instance of vim.fn.getcwd() with vim.fn.getcwd( -1,-1) and see if it breaks anything.
My workflow involves using tabs which each have their own working directory set using
:tcd
.Right now if I
:qa
to quit and leave all my tabs intact then auto-session saves to a session based on the cwd of whichever tab I quit from. This would also be an issue if someone used:lcd
to set the current working directory of a window.I can see this is because
Lib.escaped_session_name_from_cwd()
usesvim.fn.getcwd()
. When called with no argument it tries to get the cwd of the window first, if that's not set then the cwd of the tab, if that's not set then the global cwd.The simple solution is to change the code to use
vim.fn.getcwd( -1,-1)
which would return the global working directory which only gets changed by using:cd
. (This might not be the right place, I had a quick look through the code and this seems like where the cwd is chosen.)I thought I had configured the plugin incorrectly as every time I left from a tab other than the first one I would lose my session. After looking at all the sessions being saved I figured out what was happening.
The text was updated successfully, but these errors were encountered: