fix: buffers component crash on unlisted buffers

Seems like get_buf_option doesn't work on unlosted buffers.
reverting back to using fn.buflisted()

fixes #532
This commit is contained in:
shadmansaleh 2022-01-04 23:30:21 +06:00
parent 02e1f6cd5b
commit 52725d2ca8
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ function M:update_status()
local data = {} local data = {}
local buffers = {} local buffers = {}
for b = 1, vim.fn.bufnr('$') do for b = 1, vim.fn.bufnr('$') do
if vim.api.nvim_buf_get_option(b, 'buflisted') and vim.api.nvim_buf_get_option(b, 'buftype') ~= 'quickfix' then if vim.fn.buflisted(b) ~= 0 and vim.api.nvim_buf_get_option(b, 'buftype') ~= 'quickfix' then
buffers[#buffers + 1] = Buffer({ bufnr = b, options = self.options, highlights = self.highlights }) buffers[#buffers + 1] = Buffer({ bufnr = b, options = self.options, highlights = self.highlights })
end end
end end