In windows OS, saving dirsession with resession.save(vim.fn.getcwd(), { dir = "dirsession", notify = false }) doesn't work.
vim.fn.getcwd() includes the drive name in front, e.g. C:\path\to\cwd, which is not handled by get_session_file(), causing it to return faulty json file path like C:\nvim-data\dirsession\C:_path_to_cwd.json.
This fix does another gsub to replace : with _. If there's a better way to do it, let me know.
In windows OS, saving dirsession with
resession.save(vim.fn.getcwd(), { dir = "dirsession", notify = false })
doesn't work.vim.fn.getcwd()
includes the drive name in front, e.g.C:\path\to\cwd
, which is not handled byget_session_file()
, causing it to return faulty json file path likeC:\nvim-data\dirsession\C:_path_to_cwd.json
.This fix does another gsub to replace
:
with_
. If there's a better way to do it, let me know.Thanks!