You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use rmagatti/auto-session to manage nvim sessions. Beacon seems to work great without a fresh session, but when ever resuming a session beacon throws errors due to invalid buffer ids
Error executing vim.schedule lua callback: ...eytrue/.local/share/nvim/lazy/beacon.nvim/lua/beacon.lua:38: Invalid buffer id: 2
stack traceback:
[C]: in function 'nvim_open_win'
...eytrue/.local/share/nvim/lazy/beacon.nvim/lua/beacon.lua:38: in function 'create_window'
...eytrue/.local/share/nvim/lazy/beacon.nvim/lua/beacon.lua:76: in function <...eytrue/.local/share/nvim/lazy/beacon.nvim/lua/beacon.lua:56>
Maybe a race condition? Maybe auto-session is removing buffers that don't exist in the session?
The text was updated successfully, but these errors were encountered:
The problem is the incorrect buffer id of beacon's fake buffer that it uses to play the animation, in beacon.lua, l.31:
local fake_buffer = vim.api.nvim_create_buf(false, true)
local function create_window(cfg)
local window = vim.api.nvim_open_win(fake_buffer, false, { -- <-- fake_buffer is off if session was loaded with at least one buffer
relative = 'cursor',
row = 0,
col = 0,
width = cfg.width,
height = 1,
style = 'minimal',
focusable = false,
noautocmd = true,
})
My workaround is to lazy-load beacon on the "CursorMoved" event, and I haven't encountered any issues so far:
I use rmagatti/auto-session to manage nvim sessions. Beacon seems to work great without a fresh session, but when ever resuming a session beacon throws errors due to invalid buffer ids
Maybe a race condition? Maybe auto-session is removing buffers that don't exist in the session?
The text was updated successfully, but these errors were encountered: