From 52725d2ca87c38e3cf479993afcbdd36e5c81a26 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Tue, 4 Jan 2022 23:30:21 +0600 Subject: [PATCH] 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 --- lua/lualine/components/buffers/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lualine/components/buffers/init.lua b/lua/lualine/components/buffers/init.lua index e2f0011..c0ab456 100644 --- a/lua/lualine/components/buffers/init.lua +++ b/lua/lualine/components/buffers/init.lua @@ -66,7 +66,7 @@ function M:update_status() local data = {} local buffers = {} 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 }) end end