Problem: Normally, <c-g> and :w will output a message with the current buffer's filename relative the the cwd. However, when the buffer is restored from a session, the message (as well as the default statusline) show the filename relative the home directory instead. This doesn't seem to happen in tab-scoped sessions where each tab has its own cwd.
Before saving session (cwd set to ~/Documents):
After restoring session:
In the "after" screenshot, the cwd is set correctly, but the filename is displayed as if it were set to the home directory.
Solution: This PR resolves the issue by setting global options upon loading the first buffer. It also uses the lua api to set the cwd instead of vim.cmd.
Problem: Normally,
<c-g>
and:w
will output a message with the current buffer's filename relative the the cwd. However, when the buffer is restored from a session, the message (as well as the default statusline) show the filename relative the home directory instead. This doesn't seem to happen in tab-scoped sessions where each tab has its own cwd.Before saving session (cwd set to
~/Documents
):After restoring session:
In the "after" screenshot, the cwd is set correctly, but the filename is displayed as if it were set to the home directory.
Solution: This PR resolves the issue by setting global options upon loading the first buffer. It also uses the lua api to set the cwd instead of
vim.cmd
.