Closed neandrake closed 6 months ago
This doesn't work for me. When I have autoload = true
and try nvim .
I don't get a session autoloading. If I do nvim
on its own, I do.
Could you share more of your persisted configuration? I double-checked that I have this change applied and the test cases I've confirmed are:
$ nvim
$ nvim .
$ nvim subdir
For each testing without existing session file, opening new buffers, closing then restoring. I haven't fully tested on Windows but I did confirm the vim.loop.fs_realpath()
returns the same results expected here -- .
resolves to current path, subdir
expands to absolute path and nonexistant
returns nil
.
I've also re-tested both git repo folders and non-git repo folders, both of which behave as expected.
Update: I patched these changes on a Windows system and verified the same behaviors.
Damn! Turned out oil.nvim
was intercepting the autoload.
Thanks for the PR!
The
vim.loop.fs_realpath()
function can be used to properly resolve both the.
shortcut as well as relative paths. This corrects scenarios when opening nvim to a subdirectory of the working directory. With this change doing so will properly resolve the session file to the directory that was specified on the command line.This will result in using the path
/Users/username/.config/nvim
for the session. The behavior will be the same as running plainnvim
from within the/Users/username/.config/nvim
directory itself.This change also quotes the path passed to
git
to properly handle paths containing spaces.This change also corrects some typos in the readme.