Closed lbrtdy closed 7 months ago
Found the cause. I have git configured to use nvimdiff
as a diff/merge tool when doing git difftool
. Git generates a temp file to use in the ORIGINAL split and the file itself in the CHANGED split. Exiting this diff session causes the temp file path to be saved and restored the next time, thus resulting in a blank file.
This is not a bug. I suppose it could be a feature request to not auto-save sessions when neovim is invoked as a difftool.
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.9.4
Operating system/version
Debian
Describe the bug
After using LazyVim distribution for a while with multiple files loaded in the buffer and splits being used to display 2 files side by side, I quit Neovim and relaunch. Upon restoring the session by pressing the "s" hotkey, I noticed that this temp file takes up one of the splits. The other split is occupied by the actual file that this temp file is for. My buffer is sometimes cleared such that only these 2 files are listed despite having more files when quitting Neovim originally.
This issue is not 100% reproducible. I do encounter it multiple times a day due to me restoring sessions so much.
Steps To Reproduce
<leader> w |
<leader> <leader>
:qa
s
at landing pageExpected Behavior
Session is restored such that splits contain the correct files and the buffer contains list of previous files.
Actual Behavior