I set my own g:workspace_session_directory in _vimrc , when vim-workspace creates a new session, it fail to create the session storage folder whose name contains opened project path. I looked into code of vim-workspace and figured out this problem is caused by not replacing character : and \ properly in Windows-style path. I modified the function GetSessionDirectoryPath() in plugin/workspace.vim and it's worked.
Modified GetSessionDirectoryPath():
function! s:GetSessionDirectoryPath()
if !isdirectory(g:workspace_session_directory)
call mkdir(g:workspace_session_directory)
endif
let l:cwd = getcwd()
if has('win32')
let l:fileName = substitute(l:cwd, '\', '%', 'g')
let l:fileName = substitute(l:fileName, ':', '%', 'g')
else
let l:fileName = substitute(l:cwd, '/', '%', 'g')
endif
let l:fullPath = g:workspace_session_directory . l:fileName
return l:fullPath
endfunction
I set my own g:workspace_session_directory in _vimrc , when vim-workspace creates a new session, it fail to create the session storage folder whose name contains opened project path. I looked into code of vim-workspace and figured out this problem is caused by not replacing character
:
and\
properly in Windows-style path. I modified the functionGetSessionDirectoryPath()
inplugin/workspace.vim
and it's worked.Modified
GetSessionDirectoryPath()
: