Closed MuhammadSawalhy closed 5 months ago
Not sure if it possible to fix since sessions are sourced after Neovim startup (VimEnter
autocmd).
I think you can block execution using so while (session not loaded)
loop, and read the session loading status using some variables or read from a file such as /tmp/neovim-session-manager/(random-id)
, and the random-id
will be generated before the while loop and session no loaded
is read from this file with this random id. When the aysnc loading is done, some text will be written in that file. Finally, delete the file.
We as programmers can find some indirect workaround, I hope you will find one.
No, this won't work, the problem is that Neovim is loaded first, and then the session. If you have any ideas, please send a PR.
I have found the cause:
By removing the vim.schedule
from utils.load_session
, it removes the slight flicker of the intro screen.
But this may causes a slowdown when starting vim (the entire ui waits for loading buffers and starting lazy-load plugins).
It required some tweaking to get working fast.
Maybe it should be an option where there is a load_startup_session
with no vim.schedule
and docs explaining how to make it faster.
(I've used some scheduling shenanigans to get it load this fast.) (you can take a look at my config, used a User aucmd to defer running the plugins)
Feel free to open a PR to update the readme.
Bug description
When I open a directory that has a stored session, this plugin loads the session but the start window opens first. I thought that this issue comes from startify plugin, but I disabled it and the issue is still happening with the default neovim start window. [[see videos below]]
Steps to reproduce
Just open a neovim in a directory with saved session
Expected behavior
To sync load the session
Screen recordings
Environment
OS: Arch Linux
Plugins commit hash: 16bc2ff389fa4e6c51d5bdaee39fa308109bf3d7