Skip to content

Conversation

@jdholtz
Copy link

@jdholtz jdholtz commented Dec 19, 2025

When setting g:prosession_dir to a custom directory without a trailing slash, this causes the last session file to be saved as <directory>last_session.txt (notice no / between <directory> and last_session.txt.

This PR uses the fnamemodify to ensure a path separator is appended at the end (while still expanding ~).

With my configuration, I had:

init = function()
    vim.g.prosession_dir = vim.fn.stdpath("data") .. "/site/session"
end,

which caused the last_session file to be saved under ~/.local/share/nvim/site/sessionlast_session.txt.

@dhruvasagar
Copy link
Owner

@jdholtz Thanks for adding this, the PR looks good however the build is broken, i'll take a look and share my thoughts accordingly.

@jdholtz
Copy link
Author

jdholtz commented Dec 31, 2025

Sounds good. I can’t figure out what’s going wrong there. The tests pass locally for me and the failing test doesn’t seem to have to do with my modifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants