Trigger SessionLoadPost upon load()
For example, this enables bufferline ordering persistence, which relies on the SessionLoadPost autocmd, ref https://github.com/akinsho/bufferline.nvim/blob/b15c6daf5a64426c69732b31a951f4e438cb6590/lua/bufferline.lua#L116
In my testing, it was necessary to wrap it in defer_fn, but I don't actually know why.
Not to be confused with persisting pinned buffers, which seems to be available since https://github.com/LazyVim/LazyVim/pull/304/files
This PR is stale because it has been open 60 days with no activity.
That alreay gets triggered. You probably load the session in an autocmd. If so, just add nested=true to the autocmd
Thanks. I don't see how/where exactly SessionLoadPost gets triggered, but it does indeed appear to happen when loading the session in the normal manner. But my use case is launching directly from terminal as such nvim +"lua require(\"persistence\").load()" in which case SessionLoadPost does not appear to get triggered, which this PR fixes. Perhaps I'm going about it wrong?
That even is triggered by neovim. Again, if it doesn work for you, it means you load the session from an autocmd without nested=trie.
There's nothing to fix here apart from your config.
Your PR would trigger the event twice in my case
Thanks. For reference, it seems the better solution is to list "akinsho/bufferline.nvim" as a dependency of "folke/persistence.nvim", in which case the bufferline ordering persists (also for my use case).
Also, if you're testing with print, then that wouldn't work because session is loaded with silent. It still fires, but won't print
Not sure what you mean about "print"?