[Bug]: howto pin a buffer through sessions switching?
tmpm697 opened this issue · comments
Your Persisted.nvim config
{
name = "PersistedHooks",
{
"User",
function(session)
require("persisted").save()
-- Delete all of the open buffers
vim.api.nvim_input("<ESC>:%bd!<CR>")
-- Don't start saving the session yet
require("persisted").stop()
end,
opts = { pattern = "PersistedTelescopeLoadPre" },
},
},
Error messages
No response
Describe the bug
I want to pin / sticky a buffer through sessions save/switching, more verbose below:
Reproduce the bug
- at sessionA
- :term
<C-\><C-n>
to bring terminal buffer to normal mode (you can now switch to other buffers)- open some buffers under sessionA
- :SessionSave
- switch to sessionB --> with above minimal config, terminal buffer from sessionA will be deleted
How to not save terminal buffer from sessionA at step 5? other buffers at step 4 should still be saved to sessionA.
When switch to sessionB at step 6, terminal buffer from sessionA should be avail/merged to sessionB buffers list
Final checks
- I have made sure this issue exists in the latest version of the plugin
- I have tested with the
minimal.lua
config file above and still get the issue - I have used
SessionSave
to save the session before restarting Neovim and usingSessionLoad
- I have made sure this is not a duplicate issue
I'm not sure this is a bug and is more of a how to.
Suggest opening a discussion so others can feed in