Skip to content

Commit

Permalink
refactor: check exists before listed
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsho authored Jun 23, 2024
1 parent 9d244bf commit 10e6027
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/bufferline/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ M.path_sep = fn.has("win32") == 1 and "\\" or "/"
function M.is_valid(buf_num)
if not buf_num or buf_num < 1 then return false end
local exists = vim.api.nvim_buf_is_valid(buf_num)
return vim.bo[buf_num].buflisted and exists
return exists and vim.bo[buf_num].buflisted
end

---@return integer
Expand Down

0 comments on commit 10e6027

Please sign in to comment.