bufferline.nvim
bufferline.nvim copied to clipboard
fix(pinned): buffer does not exist after switching sessions
Hello,
I've been experimenting with pinned buffers and sessions, and I encountered an error.
Steps to reproduce:
- Pin a buffer
- Restore a Vim session
- Pin another buffer
Error Message:
Error executing Lua callback: ...hare/nvim/lazy/bufferline.nvim/lua/bufferline/groups.lua:154: Invalid buffer id: 3
stack traceback:
[C]: in function 'nvim_buf_get_name'
...hare/nvim/lazy/bufferline.nvim/lua/bufferline/groups.lua:154: in function 'persist_pinned_buffers'
...hare/nvim/lazy/bufferline.nvim/lua/bufferline/groups.lua:323: in function 'add_element'
...hare/nvim/lazy/bufferline.nvim/lua/bufferline/groups.lua:486: in function 'toggle_pin'
...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:172: in function <...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:172>
Video:
I believe a possible solution could be updating the buffer IDs, but I wanted to get another opinion before spending more time on it. My current fix only suppresses the error messages, but the incorrect buffer IDs are still in memory. Perhaps I'm overlooking something.