Skip to content

Conversation

@zkygr
Copy link

@zkygr zkygr commented Sep 15, 2024

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:

bufferline_error.webm

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.

1) After restoring a session, the buffer ids have changed and the old
   ones are not valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant