diff --git a/lua/bufferline/groups.lua b/lua/bufferline/groups.lua index a1aefc25..b9e5b364 100644 --- a/lua/bufferline/groups.lua +++ b/lua/bufferline/groups.lua @@ -150,7 +150,9 @@ local group_state = { local function persist_pinned_buffers() local pinned = {} for buf, group in pairs(group_state.manual_groupings) do - if group == PINNED_ID then table.insert(pinned, api.nvim_buf_get_name(buf)) end + if group == PINNED_ID and vim.fn.bufexists(buf) == 1 then + table.insert(pinned, api.nvim_buf_get_name(buf)) + end end if #pinned == 0 then