Skip to content

Commit

Permalink
fix: add check to ensure that buffer is loaded (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravibrock authored May 28, 2024
1 parent 79f7d16 commit d181f2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/barbar/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ function events.enable()

create_autocmd('DiagnosticChanged', {
callback = function(event)
state.update_diagnostics(event.buf)
render.update()
if vim.api.nvim_buf_is_loaded(event.buf) then
state.update_diagnostics(event.buf)
render.update()
end
end,
group = augroup_render,
})
Expand Down

0 comments on commit d181f2c

Please sign in to comment.