feat(picker.buffer): add filetype to bufname for buffers without name

This commit is contained in:
Folke Lemaitre 2025-01-19 23:26:16 +01:00
parent da5556aa6b
commit 83baea06d6
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -23,7 +23,9 @@ function M.buffers(opts, filter)
and (opts.nofile or vim.bo[buf].buftype ~= "nofile")
if keep then
local name = vim.api.nvim_buf_get_name(buf)
name = name == "" and "[No Name]" or name
if name == "" then
name = "[No Name]" .. (vim.bo[buf].filetype ~= "" and " " .. vim.bo[buf].filetype or "")
end
local info = vim.fn.getbufinfo(buf)[1]
local flags = {
buf == current_buf and "%" or (buf == alternate_buf and "#" or ""),