stevearc / resession.nvim

A replacement for mksession with a better API
MIT License
175 stars 13 forks source link

fix: colon appearing in filepath for windows OS dirsession #55

Closed heiku-jiqu closed 2 months ago

heiku-jiqu commented 2 months ago

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.

Thanks!

stevearc commented 2 months ago

The approach looks fine to me. Thanks for the PR!