utils: bufilter: Check for nil

it will be empty if tabufline is disabled
This commit is contained in:
Akianonymus 2022-08-17 21:13:12 +05:30 committed by Sidhanth Rathod
parent d9cd55fc0f
commit ce86597c3d
1 changed files with 5 additions and 1 deletions

View File

@ -175,7 +175,11 @@ M.packer_sync = function(...)
end
M.bufilter = function()
local bufs = vim.t.bufs
local bufs = vim.t.bufs or nil
if not bufs then
return {}
end
for i = #bufs, 1, -1 do
if not vim.api.nvim_buf_is_valid(bufs[i]) then