Skip to content

Commit

Permalink
fix: buffer data cleared when setting buflisted = false
Browse files Browse the repository at this point in the history
For posterity: this was a very painful lesson. Turns out "BufDelete"
doesn't mean "buffer was deleted", it means "buffer was deleted from the
buffer list". If you set nobuflisted, BufDelete will be triggered even
though the buffer is still loaded and active.
  • Loading branch information
stevearc committed Nov 20, 2023
1 parent 6566f45 commit 303f318
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/oil/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ M.initialize = function(bufnr)
end, 100)
end,
})
vim.api.nvim_create_autocmd("BufDelete", {
vim.api.nvim_create_autocmd("BufUnload", {
group = "Oil",
nested = true,
once = true,
Expand Down

0 comments on commit 303f318

Please sign in to comment.